| Index: src/trusted/validator_ragel/gen/validator_x86_32.c
|
| ===================================================================
|
| --- src/trusted/validator_ragel/gen/validator_x86_32.c (revision 9996)
|
| +++ src/trusted/validator_ragel/gen/validator_x86_32.c (working copy)
|
| @@ -3,6 +3,14 @@
|
| * Compiled for ia32 mode.
|
| */
|
|
|
| +/*
|
| + * This is the core of ia32-mode validator. Please note that this file
|
| + * combines ragel machine description and C language actions. Please read
|
| + * validator_internals.html first to understand how the whole thing is built:
|
| + * it explains how the byte sequences are constructed, what constructs like
|
| + * β@{}β or βREX_WRX?β mean, etc.
|
| + */
|
| +
|
| #include <assert.h>
|
| #include <errno.h>
|
| #include <stddef.h>
|
| @@ -10,7 +18,7 @@
|
| #include <stdlib.h>
|
| #include <string.h>
|
|
|
| -#include "native_client/src/trusted/validator_ragel/unreviewed/validator_internal.h"
|
| +#include "native_client/src/trusted/validator_ragel/validator_internal.h"
|
|
|
| /* Ignore this information: it's not used by security model in IA32 mode. */
|
| #undef GET_VEX_PREFIX3
|
| @@ -613,7 +621,7 @@
|
| goto st246;
|
| tr418:
|
| {
|
| - BitmapClearBit(valid_targets, (current_position - data) - 1);
|
| + MakeInvalidJumpTarget((current_position - data) - 1, valid_targets);
|
| instruction_start -= 3;
|
| instruction_info_collected |= SPECIAL_INSTRUCTION;
|
| }
|
| @@ -636,7 +644,7 @@
|
| goto st246;
|
| tr419:
|
| {
|
| - BitmapClearBit(valid_targets, (current_position - data) - 1);
|
| + MakeInvalidJumpTarget((current_position - data) - 1, valid_targets);
|
| instruction_start -= 3;
|
| instruction_info_collected |= SPECIAL_INSTRUCTION;
|
| }
|
| @@ -655,7 +663,7 @@
|
| goto st246;
|
| tr433:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| if ((instruction_info_collected & VALIDATION_ERRORS_MASK) ||
|
| @@ -672,7 +680,7 @@
|
| goto st246;
|
| tr442:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| { SET_CPU_FEATURE(CPUFeature_x87); }
|
| {
|
| @@ -950,7 +958,7 @@
|
| goto st1;
|
| tr427:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st1;
|
| st1:
|
| @@ -1092,7 +1100,7 @@
|
| goto st3;
|
| tr443:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st3;
|
| st3:
|
| @@ -1258,7 +1266,7 @@
|
| goto st10;
|
| tr428:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st10;
|
| st10:
|
| @@ -1283,7 +1291,7 @@
|
| goto st11;
|
| tr429:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st11;
|
| st11:
|
| @@ -1318,7 +1326,7 @@
|
| goto _out;
|
| tr430:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st15;
|
| st15:
|
| @@ -1729,7 +1737,7 @@
|
| goto st29;
|
| tr440:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st29;
|
| st29:
|
| @@ -1934,7 +1942,7 @@
|
| goto st34;
|
| tr437:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st34;
|
| st34:
|
| @@ -2219,7 +2227,7 @@
|
| goto tr16;
|
| tr459:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st46;
|
| st46:
|
| @@ -2403,7 +2411,7 @@
|
| goto tr16;
|
| tr431:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_BRANCH_NOT_TAKEN(TRUE);
|
| @@ -2411,7 +2419,7 @@
|
| goto st54;
|
| tr432:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_BRANCH_TAKEN(TRUE);
|
| @@ -2435,7 +2443,7 @@
|
| goto tr16;
|
| tr438:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st56;
|
| st56:
|
| @@ -2445,7 +2453,7 @@
|
| goto tr123;
|
| tr434:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st57;
|
| st57:
|
| @@ -2504,7 +2512,7 @@
|
| goto tr16;
|
| tr435:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_DATA16_PREFIX(TRUE);
|
| @@ -3070,7 +3078,7 @@
|
| goto st89;
|
| tr444:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st96;
|
| st96:
|
| @@ -3155,7 +3163,7 @@
|
| goto tr16;
|
| tr449:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st98;
|
| st98:
|
| @@ -3501,7 +3509,7 @@
|
| goto tr0;
|
| tr466:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st109;
|
| st109:
|
| @@ -3551,7 +3559,7 @@
|
| goto st110;
|
| tr436:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st110;
|
| st110:
|
| @@ -3689,7 +3697,7 @@
|
| goto st112;
|
| tr439:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st119;
|
| st119:
|
| @@ -3899,7 +3907,7 @@
|
| goto tr16;
|
| tr441:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st121;
|
| st121:
|
| @@ -4482,7 +4490,7 @@
|
| goto tr16;
|
| tr445:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st149;
|
| st149:
|
| @@ -6009,7 +6017,7 @@
|
| goto tr16;
|
| tr446:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st199;
|
| st199:
|
| @@ -6186,7 +6194,7 @@
|
| goto tr16;
|
| tr447:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st204;
|
| st204:
|
| @@ -6213,7 +6221,7 @@
|
| goto tr16;
|
| tr448:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st205;
|
| st205:
|
| @@ -6240,7 +6248,7 @@
|
| goto tr16;
|
| tr450:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st206;
|
| st206:
|
| @@ -6289,7 +6297,7 @@
|
| goto tr377;
|
| tr451:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st207;
|
| st207:
|
| @@ -6359,7 +6367,7 @@
|
| goto tr377;
|
| tr452:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st208;
|
| st208:
|
| @@ -6431,7 +6439,7 @@
|
| goto tr379;
|
| tr453:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st209;
|
| st209:
|
| @@ -6502,7 +6510,7 @@
|
| goto tr16;
|
| tr454:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st210;
|
| st210:
|
| @@ -6554,7 +6562,7 @@
|
| goto tr377;
|
| tr455:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st211;
|
| st211:
|
| @@ -6620,7 +6628,7 @@
|
| goto tr377;
|
| tr456:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st212;
|
| st212:
|
| @@ -6675,7 +6683,7 @@
|
| goto tr377;
|
| tr457:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st213;
|
| st213:
|
| @@ -6733,7 +6741,7 @@
|
| goto tr377;
|
| tr458:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st214;
|
| st214:
|
| @@ -6758,7 +6766,7 @@
|
| goto tr387;
|
| tr460:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_LOCK_PREFIX(TRUE);
|
| @@ -6862,7 +6870,7 @@
|
| goto tr16;
|
| tr461:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_REPNZ_PREFIX(TRUE);
|
| @@ -6942,7 +6950,7 @@
|
| goto tr404;
|
| tr462:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_REPZ_PREFIX(TRUE);
|
| @@ -7009,7 +7017,7 @@
|
| goto tr16;
|
| tr463:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st228;
|
| st228:
|
| @@ -7078,7 +7086,7 @@
|
| goto tr0;
|
| tr464:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st229;
|
| st229:
|
| @@ -7147,7 +7155,7 @@
|
| goto tr0;
|
| tr465:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st230;
|
| st230:
|
| @@ -7178,7 +7186,7 @@
|
| goto tr16;
|
| tr467:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st231;
|
| st231:
|
| @@ -7380,7 +7388,7 @@
|
| goto tr16;
|
| tr468:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st233;
|
| st233:
|
| @@ -7582,7 +7590,7 @@
|
| goto tr16;
|
| tr469:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st235;
|
| st235:
|
| @@ -7784,7 +7792,7 @@
|
| goto tr16;
|
| tr470:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st237;
|
| st237:
|
| @@ -7986,7 +7994,7 @@
|
| goto tr16;
|
| tr471:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st239;
|
| st239:
|
| @@ -8188,7 +8196,7 @@
|
| goto tr16;
|
| tr472:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st241;
|
| st241:
|
| @@ -8390,7 +8398,7 @@
|
| goto tr16;
|
| tr473:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st243;
|
| st243:
|
| @@ -8592,7 +8600,7 @@
|
| goto tr16;
|
| tr474:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st245;
|
| st245:
|
|
|