| Index: src/trusted/validator_ragel/gen/validator_x86_32.c
|
| ===================================================================
|
| --- src/trusted/validator_ragel/gen/validator_x86_32.c (revision 10967)
|
| +++ src/trusted/validator_ragel/gen/validator_x86_32.c (working copy)
|
| @@ -19,7 +19,7 @@
|
| #include <string.h>
|
|
|
| #include "native_client/src/trusted/validator_ragel/bitmap.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
|
| @@ -30,6 +30,10 @@
|
|
|
|
|
|
|
| +/*
|
| + * The "write data" statement causes Ragel to emit the constant static data
|
| + * needed by the ragel machine.
|
| + */
|
|
|
| static const int x86_32_validator_start = 234;
|
| static const int x86_32_validator_first_final = 234;
|
| @@ -39,7 +43,6 @@
|
|
|
|
|
|
|
| -
|
| Bool ValidateChunkIA32(const uint8_t *data, size_t size,
|
| uint32_t options,
|
| const NaClCPUFeaturesX86 *cpu_features,
|
| @@ -76,7 +79,7 @@
|
| /*
|
| * This option is usually used in tests: we will process the whole chunk
|
| * in one pass. Usually each bundle is processed separately which means
|
| - * instructions (and super-instructions) can not cross borders of the bundle.
|
| + * instructions (and "superinstructions") can not cross borders of the bundle.
|
| */
|
| if (options & PROCESS_CHUNK_AS_A_CONTIGUOUS_STREAM)
|
| end_of_bundle = data + size;
|
| @@ -100,11 +103,19 @@
|
| uint32_t instruction_info_collected = 0;
|
| int current_state;
|
|
|
| + /*
|
| + * The "write init" statement causes Ragel to emit initialization code.
|
| + * This should be executed once before the ragel machine is started.
|
| + */
|
|
|
| {
|
| ( current_state) = x86_32_validator_start;
|
| }
|
|
|
| + /*
|
| + * The "write exec" statement causes Ragel to emit the ragel machine's
|
| + * execution code.
|
| + */
|
|
|
| {
|
| if ( ( current_position) == ( end_of_bundle) )
|
| @@ -2618,13 +2629,21 @@
|
| case 36:
|
| switch( (*( current_position)) ) {
|
| case 4u: goto tr95;
|
| + case 5u: goto tr96;
|
| case 12u: goto tr95;
|
| + case 13u: goto tr96;
|
| case 20u: goto tr95;
|
| + case 21u: goto tr96;
|
| case 28u: goto tr95;
|
| + case 29u: goto tr96;
|
| case 36u: goto tr95;
|
| + case 37u: goto tr96;
|
| case 44u: goto tr95;
|
| + case 45u: goto tr96;
|
| case 52u: goto tr95;
|
| + case 53u: goto tr96;
|
| case 60u: goto tr95;
|
| + case 61u: goto tr96;
|
| case 68u: goto tr98;
|
| case 76u: goto tr98;
|
| case 84u: goto tr98;
|
| @@ -2642,39 +2661,15 @@
|
| case 180u: goto tr99;
|
| case 188u: goto tr99;
|
| }
|
| - if ( (*( current_position)) < 38u ) {
|
| - if ( (*( current_position)) < 14u ) {
|
| - if ( (*( current_position)) > 3u ) {
|
| - if ( 6u <= (*( current_position)) && (*( current_position)) <= 11u )
|
| - goto tr94;
|
| - } else
|
| - goto tr94;
|
| - } else if ( (*( current_position)) > 19u ) {
|
| - if ( (*( current_position)) > 27u ) {
|
| - if ( 30u <= (*( current_position)) && (*( current_position)) <= 35u )
|
| - goto tr94;
|
| - } else if ( (*( current_position)) >= 22u )
|
| - goto tr94;
|
| - } else
|
| + if ( (*( current_position)) < 64u ) {
|
| + if ( (*( current_position)) <= 63u )
|
| goto tr94;
|
| - } else if ( (*( current_position)) > 43u ) {
|
| - if ( (*( current_position)) < 62u ) {
|
| - if ( (*( current_position)) > 51u ) {
|
| - if ( 54u <= (*( current_position)) && (*( current_position)) <= 59u )
|
| - goto tr94;
|
| - } else if ( (*( current_position)) >= 46u )
|
| - goto tr94;
|
| - } else if ( (*( current_position)) > 63u ) {
|
| - if ( (*( current_position)) > 127u ) {
|
| - if ( 192u <= (*( current_position)) )
|
| - goto tr16;
|
| - } else if ( (*( current_position)) >= 64u )
|
| - goto tr97;
|
| - } else
|
| - goto tr94;
|
| + } else if ( (*( current_position)) > 127u ) {
|
| + if ( 128u <= (*( current_position)) && (*( current_position)) <= 191u )
|
| + goto tr96;
|
| } else
|
| - goto tr94;
|
| - goto tr96;
|
| + goto tr97;
|
| + goto tr16;
|
| st37:
|
| if ( ++( current_position) == ( end_of_bundle) )
|
| goto _test_eof37;
|
| @@ -3432,13 +3427,21 @@
|
| case 64:
|
| switch( (*( current_position)) ) {
|
| case 4u: goto tr159;
|
| + case 5u: goto tr160;
|
| case 12u: goto tr159;
|
| + case 13u: goto tr160;
|
| case 20u: goto tr159;
|
| + case 21u: goto tr160;
|
| case 28u: goto tr159;
|
| + case 29u: goto tr160;
|
| case 36u: goto tr159;
|
| + case 37u: goto tr160;
|
| case 44u: goto tr159;
|
| + case 45u: goto tr160;
|
| case 52u: goto tr159;
|
| + case 53u: goto tr160;
|
| case 60u: goto tr159;
|
| + case 61u: goto tr160;
|
| case 68u: goto tr162;
|
| case 76u: goto tr162;
|
| case 84u: goto tr162;
|
| @@ -3456,39 +3459,15 @@
|
| case 180u: goto tr163;
|
| case 188u: goto tr163;
|
| }
|
| - if ( (*( current_position)) < 38u ) {
|
| - if ( (*( current_position)) < 14u ) {
|
| - if ( (*( current_position)) > 3u ) {
|
| - if ( 6u <= (*( current_position)) && (*( current_position)) <= 11u )
|
| - goto tr146;
|
| - } else
|
| - goto tr146;
|
| - } else if ( (*( current_position)) > 19u ) {
|
| - if ( (*( current_position)) > 27u ) {
|
| - if ( 30u <= (*( current_position)) && (*( current_position)) <= 35u )
|
| - goto tr146;
|
| - } else if ( (*( current_position)) >= 22u )
|
| - goto tr146;
|
| - } else
|
| + if ( (*( current_position)) < 64u ) {
|
| + if ( (*( current_position)) <= 63u )
|
| goto tr146;
|
| - } else if ( (*( current_position)) > 43u ) {
|
| - if ( (*( current_position)) < 62u ) {
|
| - if ( (*( current_position)) > 51u ) {
|
| - if ( 54u <= (*( current_position)) && (*( current_position)) <= 59u )
|
| - goto tr146;
|
| - } else if ( (*( current_position)) >= 46u )
|
| - goto tr146;
|
| - } else if ( (*( current_position)) > 63u ) {
|
| - if ( (*( current_position)) > 127u ) {
|
| - if ( 192u <= (*( current_position)) )
|
| - goto tr16;
|
| - } else if ( (*( current_position)) >= 64u )
|
| - goto tr161;
|
| - } else
|
| - goto tr146;
|
| + } else if ( (*( current_position)) > 127u ) {
|
| + if ( 128u <= (*( current_position)) && (*( current_position)) <= 191u )
|
| + goto tr160;
|
| } else
|
| - goto tr146;
|
| - goto tr160;
|
| + goto tr161;
|
| + goto tr16;
|
| st65:
|
| if ( ++( current_position) == ( end_of_bundle) )
|
| goto _test_eof65;
|
| @@ -4516,13 +4495,21 @@
|
| case 116:
|
| 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;
|
| @@ -4540,39 +4527,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;
|
| st117:
|
| if ( ++( current_position) == ( end_of_bundle) )
|
| goto _test_eof117;
|
|
|