Skip to content

Commit

Permalink
Memset MCInst to 0 on initialization.
Browse files Browse the repository at this point in the history
Old modules (and possibly the new ones as well) are not built for none zeroed MCInst.
It leads again and again to segfaults or false disassembly.
So now it is fixed.
  • Loading branch information
Rot127 committed Oct 6, 2024
1 parent f05d797 commit 09a1a06
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions MCInst.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

void MCInst_Init(MCInst *inst, cs_arch arch)
{
memset(inst, 0, sizeof(MCInst));
// unnecessary to initialize in loop . its expensive and inst->size should be honored
inst->Operands[0].Kind = kInvalid;
inst->Operands[0].ImmVal = 0;
Expand Down

0 comments on commit 09a1a06

Please sign in to comment.