Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Unified Diff: src/trusted/validator_ragel/unreviewed/dfa_validate_32.c

Issue 10883051: Add documentation for the dynamic code modifications. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator_ragel/unreviewed/dfa_validate_32.c
===================================================================
--- src/trusted/validator_ragel/unreviewed/dfa_validate_32.c (revision 9570)
+++ src/trusted/validator_ragel/unreviewed/dfa_validate_32.c (working copy)
@@ -34,7 +34,7 @@
UNREFERENCED_PARAMETER(info);
/* Instruction is unsupported by CPU, but otherwise valid. */
- if ((info & VALIDATION_ERRORS) == CPUID_UNSUPPORTED_INSTRUCTION) {
+ if ((info & VALIDATION_ERRORS_MASK) == CPUID_UNSUPPORTED_INSTRUCTION) {
*((enum NaClValidationStatus*)callback_data) =
NaClValidationFailedCpuNotSupported;
}
@@ -46,7 +46,7 @@
UNREFERENCED_PARAMETER(callback_data);
/* Stubout unsupported by CPU, but otherwise valid instructions. */
- if ((info & VALIDATION_ERRORS) == CPUID_UNSUPPORTED_INSTRUCTION) {
+ if ((info & VALIDATION_ERRORS_MASK) == CPUID_UNSUPPORTED_INSTRUCTION) {
memset((uint8_t *)begin, NACL_HALT_OPCODE, end - begin + 1);
return TRUE;
} else {
@@ -110,7 +110,7 @@
return data->copy_func(
(uint8_t *)begin_new + data->delta,
- (info & VALIDATION_ERRORS) == CPUID_UNSUPPORTED_INSTRUCTION ?
+ (info & VALIDATION_ERRORS_MASK) == CPUID_UNSUPPORTED_INSTRUCTION ?
(uint8_t *)kStubOutMem :
(uint8_t *)begin_new,
(uint8_t)(end_new - begin_new + 1));
@@ -163,7 +163,7 @@
CHECK(end_old - begin_old < MAX_INSTRUCTION_LENGTH);
/* Sanity check: old code must be valid... except for jumps. */
- CHECK(!(info & (VALIDATION_ERRORS & ~DIRECT_JUMP_OUT_OF_RANGE)));
+ CHECK(!(info & (VALIDATION_ERRORS_MASK & ~DIRECT_JUMP_OUT_OF_RANGE)));
/* Don't mask the end of bundle: may lead to overflow */
if (end_old - data->data_old == kBundleMask)
@@ -184,7 +184,7 @@
CHECK(instruction_length <= MAX_INSTRUCTION_LENGTH);
/* Unsupported instruction must have been replaced with HLTs. */
- if ((info & VALIDATION_ERRORS) == CPUID_UNSUPPORTED_INSTRUCTION) {
+ if ((info & VALIDATION_ERRORS_MASK) == CPUID_UNSUPPORTED_INSTRUCTION) {
if (memcmp(kStubOutMem, begin_old, instruction_length) == 0) {
BitmapSetBits(&(data->instruction_boundaries_new),
(begin_new - data->data_new) & kBundleMask,
@@ -195,11 +195,11 @@
/* If we have jump which jumps out of it's range... */
} else if (info & DIRECT_JUMP_OUT_OF_RANGE) {
/* then everything is fine if it's the only error and jump is unchanged! */
- if ((info & (VALIDATION_ERRORS & ~DIRECT_JUMP_OUT_OF_RANGE)) ||
+ if ((info & (VALIDATION_ERRORS_MASK & ~DIRECT_JUMP_OUT_OF_RANGE)) ||
memcmp(begin_new, begin_old, instruction_length) != 0)
return FALSE;
/* If instruction is not accepted then we have nothing to do here. */
- } else if (info & (VALIDATION_ERRORS | BAD_JUMP_TARGET)) {
+ } else if (info & (VALIDATION_ERRORS_MASK | BAD_JUMP_TARGET)) {
return FALSE;
/* Instruction is untouched: we are done. */
} if (memcmp(begin_new, begin_old, instruction_length) == 0) {
« no previous file with comments | « src/trusted/validator_ragel/gen/validator_x86_64.c ('k') | src/trusted/validator_ragel/unreviewed/dfa_validate_64.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698