Commit Graph

26 Commits

Author SHA1 Message Date
Ole André Vadla Ravnås
28d0b20ffe
Fix crash on x86 when building with MSVC (#2253)
There is a compiler bug in latest MSVC, which at the time of writing is
19.36.32535: given `switch (x)`, where `x` is 64 bits wide, the compiler
generates code that computes an incorrect jump table index. E.g. if
`x` is zero, it ends up reading the table entry at index -1.
2024-01-20 23:46:58 +08:00
Nguyen Anh Quynh
76c1c3c4e9 merge next to master 2018-07-20 12:36:50 +08:00
Richard Henderson
5423b215bf Constify backend data (#1040)
* Constify string literals

Use -Wwrite-strings to force string literals to be of
type "const char[]", then fix up all warning fallout.

* Constify common infrastructure

Step one in allowing backend data to be readonly.
Minimal changes to backends for now; just set all pointers
in common structs that aren't modified to const.

* Constify AArch64 backend

Section size changes within libcapstone.so are

-.rodata               602587
-.data.rel.ro          228416
-.data                1003746
+.rodata               769051
+.data.rel.ro          241120
+.data                 824578

* Constify ARM backend

Section size changes within libcapstone.so are

-.rodata               769051
-.data.rel.ro          241120
-.data                 824578
+.rodata               959835
+.data.rel.ro          245120
+.data                 629506

* Constify Mips backend

Section size changes within libcapstone.so are

-.rodata               959835
-.data.rel.ro          245120
-.data                 629506
+.rodata              1069851
+.data.rel.ro          256416
+.data                 508194

* Constify PowerPC backend

Section size changes within libcapstone.so are

-.rodata              1069851
-.data.rel.ro          256416
-.data                 508194
+.rodata              1142715
+.data.rel.ro          272224
+.data                 419490

* Constify Sparc backend

Section size changes within libcapstone.so are

-.rodata              1142715
-.data.rel.ro          272224
-.data                 419490
+.rodata              1175227
+.data.rel.ro          277536
+.data                 381666

* Constify SystemZ backend

Section size changes within libcapstone.so are

-.rodata              1175227
-.data.rel.ro          277536
-.data                 381666
+.rodata              1221883
+.data.rel.ro          278016
+.data                 334498

* Constify X86 backend

Section size changes within libcapstone.so are

-.rodata              1221883
-.data.rel.ro          278016
-.data                 334498
+.rodata              1533531
+.data.rel.ro          281184
+.data                  19714

* Constify XCore backend

Section size changes within libcapstone.so are

-.rodata              1533531
-.data.rel.ro          281184
-.data                  19714
+.rodata              1553026
+.data.rel.ro          281280
+.data                     40
2017-10-22 08:45:40 +08:00
Nguyen Anh Quynh
c87ccd1b89 mips: fix bugs in the last update 2015-03-02 17:31:44 +08:00
Nguyen Anh Quynh
cfe18ad7ca mips: update core 2015-03-02 15:12:42 +08:00
Nguyen Anh Quynh
5691dd4637 mips: fixed & added new instructions. also updated Ocaml/Python/Java bindings 2014-09-24 18:03:47 +08:00
Nguyen Anh Quynh
36567558b7 mips: cleanup 2014-09-15 15:25:19 +08:00
Nguyen Anh Quynh
04d9f8ee17 arm: update core with a lot more details provided in detail mode now. update Python & Java bindings to reflect the core's changes 2014-09-01 23:27:24 +08:00
Nguyen Anh Quynh
14b684e07d last commit missed a check 2014-08-25 23:45:52 +08:00
Nguyen Anh Quynh
b1e87e3e31 arm, mips, ppc, spac, x86: printAliasInstr() should handle \t (besides space) as separate char between mnemonic & operands 2014-08-25 23:27:33 +08:00
Nguyen Anh Quynh
0f0eb9851a mips: update core. this added bunch of new instructions & groups. updated Python & Java bindings accordingly 2014-08-14 18:26:39 +08:00
Nguyen Anh Quynh
0c764d4a70 mips: use SStream_concat0() instead of SStream_concat() for simple string processing whenever possible 2014-06-16 11:53:08 +08:00
Nguyen Anh Quynh
bb0744df5d do not initialize some local vars unnecessarily. this problem was introduced when we fixed C89 issues for MSVC 2014-05-12 13:41:49 +08:00
Axel 0vercl0k Souchet
779d4c75d9 first changes to get a successfully compiled version of capstone on VS2012 2014-05-08 23:44:49 +01:00
Nguyen Anh Quynh
fc83a439e5 add diet compile option (CAPSTONE_DIET option in config.mk). This reduces binary size by around 40% 2014-02-22 23:26:27 +08:00
Nguyen Anh Quynh
bc0b3b92fd mips: update core 2014-02-19 15:13:20 +08:00
Nguyen Anh Quynh
74c41ebb1d mips: simplify handling alias insn 2014-02-18 17:57:06 +08:00
Nguyen Anh Quynh
a9ffb440f8 replace strdup() with our cs_strdup(), which call cs_mem_malloc() internally 2014-01-15 18:27:01 +08:00
Nguyen Anh Quynh
75ef2426ea mips: update core 2014-01-14 23:08:20 +08:00
Nguyen Anh Quynh
56774a158c mips: printInstruction() is static function. add dummy third argument MRI to be consistent with other archs 2014-01-12 18:13:53 +08:00
Nguyen Anh Quynh
a8eb7a5ca5 rename memory function pointer types to have cs_ prefix. also rename internal function pointers my_* to have cs_mem_ prefix - suggested by Pancake 2014-01-11 12:55:31 +08:00
Nguyen Anh Quynh
24bf0d9079 add new option CS_OPT_MEM for cs_option(): this enable user-defined dynamic memory management. idea proposed by Pancake 2014-01-05 11:19:04 +08:00
Nguyen Anh Quynh
2578d3b9e6 mips: use alias registers 2013-12-19 12:26:05 +08:00
Nguyen Anh Quynh
162409e730 mips: upgrade core engine 2013-12-08 20:17:28 +08:00
Nguyen Anh Quynh
23bc1f356a fix some potential format string bugs in arm64, arm & mips 2013-12-02 16:24:56 +08:00
Nguyen Anh Quynh
26ee41aa67 initial import 2013-11-27 12:11:31 +08:00