fixed data source position not beeing correct if the end of the input was reached while decoding an invalid instruction

This commit is contained in:
flobernd 2015-03-18 16:21:09 +01:00
parent a4b07c6f83
commit 48fd678632
1 changed files with 8 additions and 8 deletions

View File

@ -1773,14 +1773,6 @@ DecodeError:
info->instrAddress = instrAddress;
info->instrDefinition = VXGetInstructionDefinition(0);
// Return with error, if the end of the input source was reached while decoding the
// invalid instruction
if (info->flags & IF_ERROR_END_OF_INPUT)
{
info->length = 0;
return false;
}
// Decrement the input position, if more than one byte was read from the input data
// source while decoding the invalid instruction
if (info->length != 1)
@ -1790,6 +1782,14 @@ DecodeError:
info->length = 1;
}
// Return with error, if the end of the input source was reached while decoding the
// invalid instruction
if (info->flags & IF_ERROR_END_OF_INPUT)
{
info->length = 0;
return false;
}
return true;
}