| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #ifndef NACL_TRUSTED_BUT_NOT_TCB | 7 #ifndef NACL_TRUSTED_BUT_NOT_TCB |
| 8 #error("This file is not meant for use in the TCB") | 8 #error("This file is not meant for use in the TCB") |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 NaClValidationStatus status; | 114 NaClValidationStatus status; |
| 115 /* TODO(pasko): Validator initialization can be slow, make it run only once. | 115 /* TODO(pasko): Validator initialization can be slow, make it run only once. |
| 116 */ | 116 */ |
| 117 const struct NaClValidatorInterface *validator = NaClCreateValidator(); | 117 const struct NaClValidatorInterface *validator = NaClCreateValidator(); |
| 118 | 118 |
| 119 /* check if NaCl thinks the given code segment is valid. */ | 119 /* check if NaCl thinks the given code segment is valid. */ |
| 120 validator->SetAllCPUFeatures((NaClCPUFeatures *) &cpu_features); | 120 validator->SetAllCPUFeatures((NaClCPUFeatures *) &cpu_features); |
| 121 status = validator->Validate( | 121 status = validator->Validate( |
| 122 vbase, mbase, size, | 122 vbase, mbase, size, |
| 123 /* stubout_mode= */ FALSE, /* readonly_text= */ FALSE, | 123 /* stubout_mode= */ FALSE, /* readonly_text= */ FALSE, |
| 124 (NaClCPUFeatures *) &cpu_features, NULL); | 124 (NaClCPUFeatures *) &cpu_features, NULL, NULL); |
| 125 switch (status) { | 125 switch (status) { |
| 126 case NaClValidationSucceeded: | 126 case NaClValidationSucceeded: |
| 127 return TRUE; | 127 return TRUE; |
| 128 default: | 128 default: |
| 129 return FALSE; | 129 return FALSE; |
| 130 } | 130 } |
| 131 } | 131 } |
| OLD | NEW |