Update capstone v4/v4 - fix meson patch list (#18686)

This commit is contained in:
pancake 2021-05-13 03:01:28 +02:00 committed by GitHub
parent bc70f322f7
commit 82b4e82b0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 30 deletions

View File

@ -36,10 +36,10 @@ CS_ARCHIVE=https://$(CS_URL_BASE)/archive
CS_UPD=20201203
# NOTE: when you update CS_TIP or CS_BRA, also update them in shlr/meson.build
ifeq ($(USE_CS4),1)
CS_TIP=aa74f5d1ba5348c0441fbff0c0c151d95d2fa459
CS_TIP=8635f65661824f7e677e7c0d1b1f620d869ed847
CS_BRA=v4
else
CS_TIP=702dbe78ca116de8ec65f122d9202c2c1f4a2b4c
CS_TIP=f278de39c1e8a9fca977b8dfeed99d6d1f8b82bf
CS_BRA=next
endif
ifeq ($(CS_COMMIT_ARCHIVE),1)

View File

@ -1,19 +0,0 @@
diff --git a/cs.c b/cs.c
index c6fa5f9..95cce96 100644
--- a/cs.c
+++ b/cs.c
@@ -707,10 +707,12 @@ cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
return CS_ERR_OK;
case CS_OPT_SKIPDATA_SETUP:
- if (value)
+ if (value) {
handle->skipdata_setup = *((cs_opt_skipdata *)value);
- if (handle->skipdata_setup.mnemonic == NULL)
+ if (handle->skipdata_setup.mnemonic == NULL) {
handle->skipdata_setup.mnemonic = SKIPDATA_MNEM;
+ }
+ }
return CS_ERR_OK;
case CS_OPT_MNEMONIC:

View File

@ -17,16 +17,27 @@ if not capstone_dep.found() or not get_option('use_sys_capstone')
error('Cannot load capstone library. Either provide capstone in ./shlr/capstone or install git, so it can be downloaded')
endif
patches_files = []
# NOTE: when you update CS_TIP or CS_BRA, also update them in shlr/Makefile
if capstone_version == 'v5'
CS_TIP = 'baa1f94cfdacd921744769bf7d93f00892ef53fa'
CS_TIP = 'f278de39c1e8a9fca977b8dfeed99d6d1f8b82bf'
CS_BRA = 'next'
patches_files = [
'fix-x86-16.patch',
'mmm.patch'
]
elif capstone_version == 'v3'
CS_TIP = '61bf71c771680033651f16cff832446e421847b1'
CS_BRA = 'v3'
elif capstone_version == 'v4'
CS_TIP = '2edae851d9fee511a57d4da32d5acecedd95d7ed'
CS_TIP = '8635f65661824f7e677e7c0d1b1f620d869ed847'
CS_BRA = 'v4'
patches_files = [
'capstone-calloc.patch',
'fix-x86-16.patch',
'sparc-crash.patch',
'sstream-null.patch'
]
else
error('Wrong capstone version selected. Please use one of the supported versions.')
endif
@ -46,13 +57,6 @@ if not capstone_dep.found() or not get_option('use_sys_capstone')
error('Cannot execute git reset command')
endif
patches_files = [
'capstone-calloc.patch',
'fix-x86-16.patch',
'sparc-crash.patch',
'sstream-null.patch'
]
message('Patching capstone with radare\'s patches')
foreach file : patches_files
patch_path = join_paths(meson.current_source_dir(), 'capstone-patches', capstone_version, file)