Commit 04849c9
committed
disas/nanomips: Fix invalid PRId64 format calling img_format()
Fix warnings such:
disas/nanomips.c:3251:64: warning: format specifies type 'char *' but the argument has type 'int64' (aka 'long long') [-Wformat]
return img_format("CACHE 0x%" PRIx64 ", %s(%s)", op_value, s_value, rs);
~~ ^~~~~~~
%lld
To avoid crashes such (kernel from commit f375ad6):
$ qemu-system-mipsel -cpu I7200 -d in_asm -kernel generic_nano32r6el_page4k
...
----------------
IN: __bzero
0x805c6084: 20c4 6950 ADDU r13, a0, a2
0x805c6088: 9089 ADDIU a0, 1
Process 70261 stopped
* thread qemu#6, stop reason = EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff0)
frame #0: 0x00000001bfe38864 libsystem_platform.dylib`_platform_strlen + 4
libsystem_platform.dylib`:
-> 0x1bfe38864 <+4>: ldr q0, [x1]
0x1bfe38868 <+8>: adr x3, #-0xc8 ; ___lldb_unnamed_symbol314
0x1bfe3886c <+12>: ldr q2, [x3], #0x10
0x1bfe38870 <+16>: and x2, x0, #0xf
Target 0: (qemu-system-mipsel) stopped.
(lldb) bt
* thread qemu#6, stop reason = EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff0)
* frame #0: 0x00000001bfe38864 libsystem_platform.dylib`_platform_strlen + 4
frame #1: 0x00000001bfce76a0 libsystem_c.dylib`__vfprintf + 4544
frame #2: 0x00000001bfd158b4 libsystem_c.dylib`_vasprintf + 280
frame #3: 0x0000000101c22fb0 libglib-2.0.0.dylib`g_vasprintf + 28
frame qemu#4: 0x0000000101bfb7d8 libglib-2.0.0.dylib`g_strdup_vprintf + 32
frame qemu#5: 0x000000010000fb70 qemu-system-mipsel`img_format(format=<unavailable>) at nanomips.c:103:14 [opt]
frame qemu#6: 0x0000000100018868 qemu-system-mipsel`SB_S9_(instruction=<unavailable>, info=<unavailable>) at nanomips.c:12616:12 [opt]
frame qemu#7: 0x000000010000f90c qemu-system-mipsel`print_insn_nanomips at nanomips.c:589:28 [opt]
Fixes: 4066c15 ("disas/nanomips: Remove IMMEDIATE functions")
Reported-by: Stefan Weil <[email protected]>
Reviewed-by: Stefan Weil <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>1 parent 2a2105a commit 04849c9
1 file changed
+20
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3252 | 3252 | | |
3253 | 3253 | | |
3254 | 3254 | | |
3255 | | - | |
| 3255 | + | |
| 3256 | + | |
3256 | 3257 | | |
3257 | 3258 | | |
3258 | 3259 | | |
| |||
3274 | 3275 | | |
3275 | 3276 | | |
3276 | 3277 | | |
3277 | | - | |
| 3278 | + | |
| 3279 | + | |
3278 | 3280 | | |
3279 | 3281 | | |
3280 | 3282 | | |
| |||
5173 | 5175 | | |
5174 | 5176 | | |
5175 | 5177 | | |
5176 | | - | |
| 5178 | + | |
5177 | 5179 | | |
5178 | 5180 | | |
5179 | 5181 | | |
| |||
11859 | 11861 | | |
11860 | 11862 | | |
11861 | 11863 | | |
11862 | | - | |
| 11864 | + | |
11863 | 11865 | | |
11864 | 11866 | | |
11865 | 11867 | | |
| |||
11905 | 11907 | | |
11906 | 11908 | | |
11907 | 11909 | | |
11908 | | - | |
| 11910 | + | |
| 11911 | + | |
11909 | 11912 | | |
11910 | 11913 | | |
11911 | 11914 | | |
| |||
12079 | 12082 | | |
12080 | 12083 | | |
12081 | 12084 | | |
12082 | | - | |
| 12085 | + | |
12083 | 12086 | | |
12084 | 12087 | | |
12085 | 12088 | | |
| |||
12613 | 12616 | | |
12614 | 12617 | | |
12615 | 12618 | | |
12616 | | - | |
| 12619 | + | |
12617 | 12620 | | |
12618 | 12621 | | |
12619 | 12622 | | |
| |||
12659 | 12662 | | |
12660 | 12663 | | |
12661 | 12664 | | |
12662 | | - | |
| 12665 | + | |
12663 | 12666 | | |
12664 | 12667 | | |
12665 | 12668 | | |
| |||
12706 | 12709 | | |
12707 | 12710 | | |
12708 | 12711 | | |
12709 | | - | |
| 12712 | + | |
12710 | 12713 | | |
12711 | 12714 | | |
12712 | 12715 | | |
| |||
12729 | 12732 | | |
12730 | 12733 | | |
12731 | 12734 | | |
12732 | | - | |
| 12735 | + | |
12733 | 12736 | | |
12734 | 12737 | | |
12735 | 12738 | | |
| |||
12776 | 12779 | | |
12777 | 12780 | | |
12778 | 12781 | | |
12779 | | - | |
| 12782 | + | |
12780 | 12783 | | |
12781 | 12784 | | |
12782 | 12785 | | |
| |||
12868 | 12871 | | |
12869 | 12872 | | |
12870 | 12873 | | |
12871 | | - | |
| 12874 | + | |
12872 | 12875 | | |
12873 | 12876 | | |
12874 | 12877 | | |
| |||
12973 | 12976 | | |
12974 | 12977 | | |
12975 | 12978 | | |
12976 | | - | |
| 12979 | + | |
12977 | 12980 | | |
12978 | 12981 | | |
12979 | 12982 | | |
| |||
13066 | 13069 | | |
13067 | 13070 | | |
13068 | 13071 | | |
13069 | | - | |
| 13072 | + | |
| 13073 | + | |
13070 | 13074 | | |
13071 | 13075 | | |
13072 | 13076 | | |
| |||
13091 | 13095 | | |
13092 | 13096 | | |
13093 | 13097 | | |
13094 | | - | |
| 13098 | + | |
| 13099 | + | |
13095 | 13100 | | |
13096 | 13101 | | |
13097 | 13102 | | |
| |||
0 commit comments