Skip to content

Commit

Permalink
Merge pull request keystone-engine#151 from practicalswift/add-crash-…
Browse files Browse the repository at this point in the history
…28-x64-llvm-error-unable-to-evaluate-offset-for-variable

Add LLVM error crash case.
  • Loading branch information
aquynh committed May 31, 2016
2 parents 5f3c7cb + 2c8fff1 commit b806b61
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <keystone/keystone.h>
int main(int argc, char **argv) {
int ks_arch = KS_ARCH_X86, ks_mode = KS_MODE_64;
unsigned char assembly[] = {
'x', '=', 'y', '-', '-', 'y', ';', '.', '=', 'x',
'-', 'y', 0x00,
};
ks_engine *ks;
ks_err err = ks_open(ks_arch, ks_mode, &ks);
if (!err) {
size_t count, size;
unsigned char *insn;
if (ks_asm(ks, (char *)assembly, 0, &insn, &size, &count))
printf("ERROR: failed on ks_asm() with error = %s, code = %u\n", ks_strerror(ks_errno(ks)), ks_errno(ks));
ks_free(insn);
}
ks_close(ks);
return 0;
}

0 comments on commit b806b61

Please sign in to comment.