Skip to content

Commit af73bed

Browse files
committed
Somebody cannot into array pointers
1 parent 5420f79 commit af73bed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Parser.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void decodeInstruction(unsigned char* instruction, int offset, int op16bit, Pars
169169
//32 bit displacement
170170
if (mod == 2)
171171
{
172-
instr_args->mem.disp = *((int*)instruction[offset + 1]);
172+
instr_args->mem.disp = *((int*)(&(instruction[offset + 1])));
173173
if (rm != 4)
174174
instr_args->mem.index = rm;
175175
instr_args->length = offset + 5;
@@ -190,7 +190,7 @@ void decodeInstruction(unsigned char* instruction, int offset, int op16bit, Pars
190190
if (rm == 5)
191191
{
192192
instr_args->mem.index = UNDEF;
193-
instr_args->mem.disp = *((int*)instruction[offset + 1]);
193+
instr_args->mem.disp = *((int*)(&(instruction[offset + 1])));
194194
instr_args->length = offset + 5;
195195
return;
196196
}

0 commit comments

Comments
 (0)