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

Unified Diff: src/trusted/validator/x86/64/ncvalidate.c

Issue 10024039: Replace kind variable from validator API with Boolean stubout parameter. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Final edits Created 8 years, 8 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/64/ncvalidate.c
diff --git a/src/trusted/validator/x86/64/ncvalidate.c b/src/trusted/validator/x86/64/ncvalidate.c
index 0322680fcc72cccc370ae18f0436de6e54df6f65..d2a990e5b835f038decdd401d15428a0926e0a89 100644
--- a/src/trusted/validator/x86/64/ncvalidate.c
+++ b/src/trusted/validator/x86/64/ncvalidate.c
@@ -103,11 +103,11 @@ NaClValidationStatus NaClApplyValidatorStubout_x86_64(
NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidator, x86, 64) (
enum NaClSBKind sb_kind,
- NaClApplyValidationKind kind,
uintptr_t guest_addr,
uint8_t *data,
size_t size,
int bundle_size,
+ int stubout_mode,
int readonly_text,
const NaClCPUFeaturesX86 *cpu_features,
struct NaClValidationCache *cache) {
@@ -116,18 +116,13 @@ NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidator, x86, 64) (
if (bundle_size == 16 || bundle_size == 32) {
if (!NaClArchSupported(cpu_features))
return NaClValidationFailedCpuNotSupported;
- switch (kind) {
- case NaClApplyCodeValidation:
- status = NaClApplyValidatorSilently_x86_64(
- guest_addr, data, size, bundle_size,
- readonly_text, cpu_features, cache);
- break;
- case NaClApplyValidationDoStubout:
- status = NaClApplyValidatorStubout_x86_64(
- guest_addr, data, size, bundle_size, cpu_features);
- break;
- default:
- break;
+ if (stubout_mode) {
+ status = NaClApplyValidatorStubout_x86_64(
+ guest_addr, data, size, bundle_size, cpu_features);
+ } else {
+ status = NaClApplyValidatorSilently_x86_64(
+ guest_addr, data, size, bundle_size,
+ readonly_text, cpu_features, cache);
}
}
return status;
« no previous file with comments | « src/trusted/validator/x86/32/ncvalidate_verbose.c ('k') | src/trusted/validator/x86/64/ncvalidate_verbose.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698