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

Unified Diff: src/trusted/validator_x86/ncenuminsts_x86_32.c

Issue 10134056: Refactor the process of choosing validators. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: small fixes towards Mark's comments Created 8 years, 6 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_x86/ncenuminsts_x86_32.c
diff --git a/src/trusted/validator_x86/ncenuminsts_x86_32.c b/src/trusted/validator_x86/ncenuminsts_x86_32.c
index 06279d1fefca31412e11f7fde9eebb6c7c137e3e..12859aedcbfc425d95fe9148efa258eecb5b4df5 100644
--- a/src/trusted/validator_x86/ncenuminsts_x86_32.c
+++ b/src/trusted/validator_x86/ncenuminsts_x86_32.c
@@ -100,10 +100,13 @@ Bool NaClSegmentValidates(uint8_t* mbase,
NaClPcAddress vbase) {
NaClCPUFeaturesX86 cpu_features;
NaClValidationStatus status;
+ /* TODO(pasko): Validator initialization can be slow, make it run only once.
+ */
+ const struct NaClValidatorInterface *validator = NaClCreateValidator();
/* check if NaCl thinks the given code segment is valid. */
NaClSetAllCPUFeatures(&cpu_features);
- status = NaCl_ApplyValidator_x86_32(
+ status = validator->Validate(
vbase, mbase, size,
/* stubout_mode= */ FALSE, /* readonly_text= */ FALSE, &cpu_features,
NULL);

Powered by Google App Engine
This is Rietveld 408576698