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

Side by Side Diff: src/trusted/validator_ragel/unreviewed/validator_x86_32.rl

Issue 12226019: Move bitmap manipulation functions in bitmap.h (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 ia32-mode validator. Please note that this file 8 * This is the core of ia32-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:
11 * it explains how the byte sequences are constructed, what constructs like 11 * it explains how the byte sequences are constructed, what constructs like
12 * “@{}” or “REX_WRX?” mean, etc. 12 * “@{}” or “REX_WRX?” mean, etc.
13 */ 13 */
14 14
15 #include <assert.h> 15 #include <assert.h>
16 #include <errno.h> 16 #include <errno.h>
17 #include <stddef.h> 17 #include <stddef.h>
18 #include <stdio.h> 18 #include <stdio.h>
19 #include <stdlib.h> 19 #include <stdlib.h>
20 #include <string.h> 20 #include <string.h>
21 21
22 #include "native_client/src/trusted/validator_ragel/bitmap.h"
22 #include "native_client/src/trusted/validator_ragel/unreviewed/validator_interna l.h" 23 #include "native_client/src/trusted/validator_ragel/unreviewed/validator_interna l.h"
23 24
24 /* Ignore this information: it's not used by security model in IA32 mode. */ 25 /* Ignore this information: it's not used by security model in IA32 mode. */
25 #undef GET_VEX_PREFIX3 26 #undef GET_VEX_PREFIX3
26 #define GET_VEX_PREFIX3 0 27 #define GET_VEX_PREFIX3 0
27 #undef SET_VEX_PREFIX3 28 #undef SET_VEX_PREFIX3
28 #define SET_VEX_PREFIX3(P) 29 #define SET_VEX_PREFIX3(P)
29 30
30 %%{ 31 %%{
31 machine x86_32_validator; 32 machine x86_32_validator;
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 */ 261 */
261 result &= ProcessInvalidJumpTargets(data, size, valid_targets, jump_dests, 262 result &= ProcessInvalidJumpTargets(data, size, valid_targets, jump_dests,
262 user_callback, callback_data); 263 user_callback, callback_data);
263 264
264 /* We only use malloc for a large code sequences */ 265 /* We only use malloc for a large code sequences */
265 if (jump_dests != jump_dests_small) free(jump_dests); 266 if (jump_dests != jump_dests_small) free(jump_dests);
266 if (valid_targets != valid_targets_small) free(valid_targets); 267 if (valid_targets != valid_targets_small) free(valid_targets);
267 if (!result) errno = EINVAL; 268 if (!result) errno = EINVAL;
268 return result; 269 return result;
269 } 270 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698