File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,8 @@ static struct qemu_plugin_scoreboard *find_counter(
253
253
int i ;
254
254
uint64_t * cnt = NULL ;
255
255
uint32_t opcode = 0 ;
256
+ /* if opcode is greater than 32 bits, we should refactor insn hash table. */
257
+ G_STATIC_ASSERT (sizeof (opcode ) == sizeof (uint32_t ));
256
258
InsnClassExecCount * class = NULL ;
257
259
258
260
/*
@@ -284,7 +286,7 @@ static struct qemu_plugin_scoreboard *find_counter(
284
286
285
287
g_mutex_lock (& lock );
286
288
icount = (InsnExecCount * ) g_hash_table_lookup (insns ,
287
- GUINT_TO_POINTER ( opcode ) );
289
+ ( gpointer )( intptr_t ) opcode );
288
290
289
291
if (!icount ) {
290
292
icount = g_new0 (InsnExecCount , 1 );
@@ -295,8 +297,7 @@ static struct qemu_plugin_scoreboard *find_counter(
295
297
qemu_plugin_scoreboard_new (sizeof (uint64_t ));
296
298
icount -> count = qemu_plugin_scoreboard_u64 (score );
297
299
298
- g_hash_table_insert (insns , GUINT_TO_POINTER (opcode ),
299
- (gpointer ) icount );
300
+ g_hash_table_insert (insns , (gpointer )(intptr_t ) opcode , icount );
300
301
}
301
302
g_mutex_unlock (& lock );
302
303
You can’t perform that action at this time.
0 commit comments