| 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 /* | 7 /* |
| 8 * This is the core of amd64-mode validator. Please note that this file | 8 * This is the core of amd64-mode validator. Please note that this file |
| 9 * combines ragel machine description and C language actions. Please read | 9 * combines ragel machine description and C language actions. Please read |
| 10 * validator_internals.html first to understand how the whole thing is built: | 10 * validator_internals.html first to understand how the whole thing is built: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 action check_memory_access { | 64 action check_memory_access { |
| 65 CheckMemoryAccess(instruction_begin - codeblock, | 65 CheckMemoryAccess(instruction_begin - codeblock, |
| 66 base, | 66 base, |
| 67 index, | 67 index, |
| 68 restricted_register, | 68 restricted_register, |
| 69 valid_targets, | 69 valid_targets, |
| 70 &instruction_info_collected); | 70 &instruction_info_collected); |
| 71 } | 71 } |
| 72 | 72 |
| 73 action forbid_or_rewrite_instruction { |
| 74 instruction_info_collected |= FORBID_OR_REWRITE_INSTRUCTION; |
| 75 } |
| 76 |
| 73 action modifiable_instruction { | 77 action modifiable_instruction { |
| 74 instruction_info_collected |= MODIFIABLE_INSTRUCTION; | 78 instruction_info_collected |= MODIFIABLE_INSTRUCTION; |
| 75 } | 79 } |
| 76 | 80 |
| 77 action process_0_operands { | 81 action process_0_operands { |
| 78 Process0Operands(&restricted_register, &instruction_info_collected); | 82 Process0Operands(&restricted_register, &instruction_info_collected); |
| 79 } | 83 } |
| 80 action process_1_operand { | 84 action process_1_operand { |
| 81 Process1Operand(&restricted_register, &instruction_info_collected, | 85 Process1Operand(&restricted_register, &instruction_info_collected, |
| 82 rex_prefix, operand_states); | 86 rex_prefix, operand_states); |
| (...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 jump_dests, | 1304 jump_dests, |
| 1301 user_callback, | 1305 user_callback, |
| 1302 callback_data); | 1306 callback_data); |
| 1303 | 1307 |
| 1304 /* We only use malloc for a large code sequences */ | 1308 /* We only use malloc for a large code sequences */ |
| 1305 if (jump_dests != &jump_dests_small) free(jump_dests); | 1309 if (jump_dests != &jump_dests_small) free(jump_dests); |
| 1306 if (valid_targets != &valid_targets_small) free(valid_targets); | 1310 if (valid_targets != &valid_targets_small) free(valid_targets); |
| 1307 if (!result) errno = EINVAL; | 1311 if (!result) errno = EINVAL; |
| 1308 return result; | 1312 return result; |
| 1309 } | 1313 } |
| OLD | NEW |