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

Unified Diff: src/trusted/validator_ragel/validator_x86_32.rl

Issue 11000033: Move validator_x86_XX.rl out of unreviewed. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 2 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/validator_x86_32.rl
===================================================================
--- src/trusted/validator_ragel/validator_x86_32.rl (revision 9911)
+++ src/trusted/validator_ragel/validator_x86_32.rl (working copy)
@@ -4,6 +4,14 @@
* found in the LICENSE file.
*/
+/*
+ * 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>
@@ -11,7 +19,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
@@ -79,7 +87,7 @@
0x83 0xe6 0xe0 0xff (0xd6|0xe6) | # naclcall/jmp %esi
0x83 0xe7 0xe0 0xff (0xd7|0xe7)) # naclcall/jmp %edi
Brad Chen 2012/10/05 16:47:21 Note: This is a case where repetition seems okay t
khim 2012/10/15 16:38:57 Even so: I've added one minor change to separate a
@{
- BitmapClearBit(valid_targets, (current_position - data) - 1);
+ MakeInvalidJumpTarget((current_position - data) - 1, valid_targets);
instruction_start -= 3;
instruction_info_collected |= SPECIAL_INSTRUCTION;
} |
@@ -104,7 +112,7 @@
main := ((call_alignment | one_instruction | special_instruction)
>{
- BitmapSetBit(valid_targets, current_position - data);
+ MakeJumpTargetValid(current_position - data, valid_targets);
}
@{
if ((instruction_info_collected &
@@ -133,7 +141,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;

Powered by Google App Engine
This is Rietveld 408576698