mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-23 05:29:53 +00:00
test_customized_mnem: avoid abort() if x86 not supported
if the library is built without X86, then cs_open() should fail but that shouldn't be treated as an error, so return instead after checking.
This commit is contained in:
parent
08d1b0ccd5
commit
80287ac96b
@ -52,8 +52,11 @@ static void test()
|
||||
|
||||
err = cs_open(CS_ARCH_X86, CS_MODE_32, &handle);
|
||||
if (err) {
|
||||
printf("Failed on cs_open() with error returned: %u\n", err);
|
||||
abort();
|
||||
if (cs_support(CS_ARCH_X86)) {
|
||||
printf("Failed on cs_open() with error returned: %u\n", err);
|
||||
abort();
|
||||
} else
|
||||
return;
|
||||
}
|
||||
|
||||
// 1. Print out the instruction in default setup.
|
||||
|
Loading…
Reference in New Issue
Block a user