| Index: src/trusted/validator_ragel/gen/validator_x86_32.c
|
| ===================================================================
|
| --- src/trusted/validator_ragel/gen/validator_x86_32.c (revision 9911)
|
| +++ src/trusted/validator_ragel/gen/validator_x86_32.c (working copy)
|
| @@ -10,7 +10,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
|
| @@ -34,7 +34,7 @@
|
| Bool ValidateChunkIA32(const uint8_t *data, size_t size,
|
| enum validation_options options,
|
| const NaClCPUFeaturesX86 *cpu_features,
|
| - validation_callback_func user_callback,
|
| + ValidationCallbackFunc user_callback,
|
| void *callback_data) {
|
| bitmap_word valid_targets_small;
|
| bitmap_word jump_dests_small;
|
| @@ -645,7 +645,7 @@
|
| goto st247;
|
| tr419:
|
| {
|
| - BitmapClearBit(valid_targets, (current_position - data) - 1);
|
| + MakeJumpTargetInvalid((current_position - data) - 1, valid_targets);
|
| instruction_start -= 3;
|
| instruction_info_collected |= SPECIAL_INSTRUCTION;
|
| }
|
| @@ -669,7 +669,7 @@
|
| goto st247;
|
| tr420:
|
| {
|
| - BitmapClearBit(valid_targets, (current_position - data) - 1);
|
| + MakeJumpTargetInvalid((current_position - data) - 1, valid_targets);
|
| instruction_start -= 3;
|
| instruction_info_collected |= SPECIAL_INSTRUCTION;
|
| }
|
| @@ -689,7 +689,7 @@
|
| goto st247;
|
| tr434:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| if ((instruction_info_collected &
|
| @@ -707,7 +707,7 @@
|
| goto st247;
|
| tr443:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| { SET_CPU_FEATURE(CPUFeature_x87); }
|
| {
|
| @@ -986,7 +986,7 @@
|
| goto st1;
|
| tr428:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st1;
|
| st1:
|
| @@ -1128,7 +1128,7 @@
|
| goto st3;
|
| tr444:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st3;
|
| st3:
|
| @@ -1294,7 +1294,7 @@
|
| goto st10;
|
| tr429:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st10;
|
| st10:
|
| @@ -1319,7 +1319,7 @@
|
| goto st11;
|
| tr430:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st11;
|
| st11:
|
| @@ -1354,7 +1354,7 @@
|
| goto _out;
|
| tr431:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st15;
|
| st15:
|
| @@ -1765,7 +1765,7 @@
|
| goto st29;
|
| tr441:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st29;
|
| st29:
|
| @@ -1774,13 +1774,21 @@
|
| case 29:
|
| switch( (*( current_position)) ) {
|
| case 4u: goto st2;
|
| + case 5u: goto st3;
|
| case 12u: goto st2;
|
| + case 13u: goto st3;
|
| case 20u: goto st2;
|
| + case 21u: goto st3;
|
| case 28u: goto st2;
|
| + case 29u: goto st3;
|
| case 36u: goto st2;
|
| + case 37u: goto st3;
|
| case 44u: goto st2;
|
| + case 45u: goto st3;
|
| case 52u: goto st2;
|
| + case 53u: goto st3;
|
| case 60u: goto st2;
|
| + case 61u: goto st3;
|
| case 68u: goto st8;
|
| case 76u: goto st8;
|
| case 84u: goto st8;
|
| @@ -1798,39 +1806,15 @@
|
| case 180u: goto st9;
|
| case 188u: goto st9;
|
| }
|
| - if ( (*( current_position)) < 38u ) {
|
| - if ( (*( current_position)) < 14u ) {
|
| - if ( (*( current_position)) > 3u ) {
|
| - if ( 6u <= (*( current_position)) && (*( current_position)) <= 11u )
|
| - goto tr0;
|
| - } else
|
| - goto tr0;
|
| - } else if ( (*( current_position)) > 19u ) {
|
| - if ( (*( current_position)) > 27u ) {
|
| - if ( 30u <= (*( current_position)) && (*( current_position)) <= 35u )
|
| - goto tr0;
|
| - } else if ( (*( current_position)) >= 22u )
|
| - goto tr0;
|
| - } else
|
| + if ( (*( current_position)) < 64u ) {
|
| + if ( (*( current_position)) <= 63u )
|
| goto tr0;
|
| - } else if ( (*( current_position)) > 43u ) {
|
| - if ( (*( current_position)) < 62u ) {
|
| - if ( (*( current_position)) > 51u ) {
|
| - if ( 54u <= (*( current_position)) && (*( current_position)) <= 59u )
|
| - goto tr0;
|
| - } else if ( (*( current_position)) >= 46u )
|
| - goto tr0;
|
| - } else if ( (*( current_position)) > 63u ) {
|
| - if ( (*( current_position)) > 127u ) {
|
| - if ( 192u <= (*( current_position)) )
|
| - goto tr16;
|
| - } else if ( (*( current_position)) >= 64u )
|
| - goto st7;
|
| - } else
|
| - goto tr0;
|
| + } else if ( (*( current_position)) > 127u ) {
|
| + if ( 128u <= (*( current_position)) && (*( current_position)) <= 191u )
|
| + goto st3;
|
| } else
|
| - goto tr0;
|
| - goto st3;
|
| + goto st7;
|
| + goto tr16;
|
| st30:
|
| if ( ++( current_position) == ( end_of_bundle) )
|
| goto _test_eof30;
|
| @@ -1986,7 +1970,7 @@
|
| goto st34;
|
| tr438:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st34;
|
| st34:
|
| @@ -2271,7 +2255,7 @@
|
| goto tr16;
|
| tr460:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st46;
|
| st46:
|
| @@ -2455,7 +2439,7 @@
|
| goto tr16;
|
| tr432:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_BRANCH_NOT_TAKEN(TRUE);
|
| @@ -2463,7 +2447,7 @@
|
| goto st54;
|
| tr433:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_BRANCH_TAKEN(TRUE);
|
| @@ -2487,7 +2471,7 @@
|
| goto tr16;
|
| tr439:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st56;
|
| st56:
|
| @@ -2497,7 +2481,7 @@
|
| goto tr123;
|
| tr435:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st57;
|
| st57:
|
| @@ -2556,7 +2540,7 @@
|
| goto tr16;
|
| tr436:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_DATA16_PREFIX(TRUE);
|
| @@ -3122,7 +3106,7 @@
|
| goto st89;
|
| tr445:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st96;
|
| st96:
|
| @@ -3207,7 +3191,7 @@
|
| goto tr16;
|
| tr450:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st98;
|
| st98:
|
| @@ -3564,7 +3548,7 @@
|
| goto tr0;
|
| tr467:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st110;
|
| st110:
|
| @@ -3614,7 +3598,7 @@
|
| goto st111;
|
| tr437:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st111;
|
| st111:
|
| @@ -3752,7 +3736,7 @@
|
| goto st113;
|
| tr440:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st120;
|
| st120:
|
| @@ -3963,7 +3947,7 @@
|
| goto tr16;
|
| tr442:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st122;
|
| st122:
|
| @@ -4546,7 +4530,7 @@
|
| goto tr16;
|
| tr446:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st150;
|
| st150:
|
| @@ -5936,13 +5920,21 @@
|
| case 196:
|
| switch( (*( current_position)) ) {
|
| case 4u: goto st35;
|
| + case 5u: goto st36;
|
| case 12u: goto st35;
|
| + case 13u: goto st36;
|
| case 20u: goto st35;
|
| + case 21u: goto st36;
|
| case 28u: goto st35;
|
| + case 29u: goto st36;
|
| case 36u: goto st35;
|
| + case 37u: goto st36;
|
| case 44u: goto st35;
|
| + case 45u: goto st36;
|
| case 52u: goto st35;
|
| + case 53u: goto st36;
|
| case 60u: goto st35;
|
| + case 61u: goto st36;
|
| case 68u: goto st41;
|
| case 76u: goto st41;
|
| case 84u: goto st41;
|
| @@ -5960,39 +5952,15 @@
|
| case 180u: goto st42;
|
| case 188u: goto st42;
|
| }
|
| - if ( (*( current_position)) < 38u ) {
|
| - if ( (*( current_position)) < 14u ) {
|
| - if ( (*( current_position)) > 3u ) {
|
| - if ( 6u <= (*( current_position)) && (*( current_position)) <= 11u )
|
| - goto st10;
|
| - } else
|
| - goto st10;
|
| - } else if ( (*( current_position)) > 19u ) {
|
| - if ( (*( current_position)) > 27u ) {
|
| - if ( 30u <= (*( current_position)) && (*( current_position)) <= 35u )
|
| - goto st10;
|
| - } else if ( (*( current_position)) >= 22u )
|
| - goto st10;
|
| - } else
|
| + if ( (*( current_position)) < 64u ) {
|
| + if ( (*( current_position)) <= 63u )
|
| goto st10;
|
| - } else if ( (*( current_position)) > 43u ) {
|
| - if ( (*( current_position)) < 62u ) {
|
| - if ( (*( current_position)) > 51u ) {
|
| - if ( 54u <= (*( current_position)) && (*( current_position)) <= 59u )
|
| - goto st10;
|
| - } else if ( (*( current_position)) >= 46u )
|
| - goto st10;
|
| - } else if ( (*( current_position)) > 63u ) {
|
| - if ( (*( current_position)) > 127u ) {
|
| - if ( 192u <= (*( current_position)) )
|
| - goto tr16;
|
| - } else if ( (*( current_position)) >= 64u )
|
| - goto st40;
|
| - } else
|
| - goto st10;
|
| + } else if ( (*( current_position)) > 127u ) {
|
| + if ( 128u <= (*( current_position)) && (*( current_position)) <= 191u )
|
| + goto st36;
|
| } else
|
| - goto st10;
|
| - goto st36;
|
| + goto st40;
|
| + goto tr16;
|
| tr343:
|
| {
|
| SET_VEX_PREFIX3(*current_position);
|
| @@ -6089,7 +6057,7 @@
|
| goto tr16;
|
| tr447:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st200;
|
| st200:
|
| @@ -6266,7 +6234,7 @@
|
| goto tr16;
|
| tr448:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st205;
|
| st205:
|
| @@ -6293,7 +6261,7 @@
|
| goto tr16;
|
| tr449:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st206;
|
| st206:
|
| @@ -6320,7 +6288,7 @@
|
| goto tr16;
|
| tr451:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st207;
|
| st207:
|
| @@ -6369,7 +6337,7 @@
|
| goto tr381;
|
| tr452:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st208;
|
| st208:
|
| @@ -6439,7 +6407,7 @@
|
| goto tr381;
|
| tr453:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st209;
|
| st209:
|
| @@ -6511,7 +6479,7 @@
|
| goto tr383;
|
| tr454:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st210;
|
| st210:
|
| @@ -6582,7 +6550,7 @@
|
| goto tr16;
|
| tr455:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st211;
|
| st211:
|
| @@ -6634,7 +6602,7 @@
|
| goto tr381;
|
| tr456:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st212;
|
| st212:
|
| @@ -6700,7 +6668,7 @@
|
| goto tr381;
|
| tr457:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st213;
|
| st213:
|
| @@ -6755,7 +6723,7 @@
|
| goto tr381;
|
| tr458:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st214;
|
| st214:
|
| @@ -6813,7 +6781,7 @@
|
| goto tr381;
|
| tr459:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st215;
|
| st215:
|
| @@ -6838,7 +6806,7 @@
|
| goto tr391;
|
| tr461:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_LOCK_PREFIX(TRUE);
|
| @@ -6942,7 +6910,7 @@
|
| goto tr16;
|
| tr462:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_REPNZ_PREFIX(TRUE);
|
| @@ -7022,7 +6990,7 @@
|
| goto tr408;
|
| tr463:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| {
|
| SET_REPZ_PREFIX(TRUE);
|
| @@ -7089,7 +7057,7 @@
|
| goto tr16;
|
| tr464:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st229;
|
| st229:
|
| @@ -7158,7 +7126,7 @@
|
| goto tr0;
|
| tr465:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st230;
|
| st230:
|
| @@ -7227,7 +7195,7 @@
|
| goto tr0;
|
| tr466:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st231;
|
| st231:
|
| @@ -7258,7 +7226,7 @@
|
| goto tr16;
|
| tr468:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st232;
|
| st232:
|
| @@ -7461,7 +7429,7 @@
|
| goto tr16;
|
| tr469:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st234;
|
| st234:
|
| @@ -7664,7 +7632,7 @@
|
| goto tr16;
|
| tr470:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st236;
|
| st236:
|
| @@ -7867,7 +7835,7 @@
|
| goto tr16;
|
| tr471:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st238;
|
| st238:
|
| @@ -8070,7 +8038,7 @@
|
| goto tr16;
|
| tr472:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st240;
|
| st240:
|
| @@ -8273,7 +8241,7 @@
|
| goto tr16;
|
| tr473:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st242;
|
| st242:
|
| @@ -8476,7 +8444,7 @@
|
| goto tr16;
|
| tr474:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st244;
|
| st244:
|
| @@ -8679,7 +8647,7 @@
|
| goto tr16;
|
| tr475:
|
| {
|
| - BitmapSetBit(valid_targets, current_position - data);
|
| + MakeJumpTargetValid(current_position - data, valid_targets);
|
| }
|
| goto st246;
|
| st246:
|
|
|