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

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

Issue 10860010: Fix uint8_t/unit32_t mix, always use wordsize access (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « src/trusted/validator_ragel/unreviewed/validator_x86_32.rl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <assert.h> 7 #include <assert.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <stdlib.h> 10 #include <stdlib.h>
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 }%% 305 }%%
306 306
307 %% write data; 307 %% write data;
308 308
309 Bool ValidateChunkAMD64(const uint8_t *data, size_t size, 309 Bool ValidateChunkAMD64(const uint8_t *data, size_t size,
310 enum validation_options options, 310 enum validation_options options,
311 const NaClCPUFeaturesX86 *cpu_features, 311 const NaClCPUFeaturesX86 *cpu_features,
312 validation_callback_func user_callback, 312 validation_callback_func user_callback,
313 void *callback_data) { 313 void *callback_data) {
314 uint8_t *valid_targets = BitmapAllocate(size); 314 bitmap_word *valid_targets = BitmapAllocate(size);
315 uint8_t *jump_dests = BitmapAllocate(size); 315 bitmap_word *jump_dests = BitmapAllocate(size);
316 const uint8_t *current_position; 316 const uint8_t *current_position;
317 const uint8_t *end_of_bundle; 317 const uint8_t *end_of_bundle;
318 int result = TRUE; 318 int result = TRUE;
319 319
320 CHECK(size % kBundleSize == 0); 320 CHECK(size % kBundleSize == 0);
321 321
322 if (!valid_targets || !jump_dests) { 322 if (!valid_targets || !jump_dests) {
323 result = FALSE; 323 result = FALSE;
324 goto error_detected; 324 goto error_detected;
325 } 325 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 } 361 }
362 362
363 result &= ProcessInvalidJumpTargets(data, size, valid_targets, jump_dests, 363 result &= ProcessInvalidJumpTargets(data, size, valid_targets, jump_dests,
364 user_callback, callback_data); 364 user_callback, callback_data);
365 365
366 error_detected: 366 error_detected:
367 free(jump_dests); 367 free(jump_dests);
368 free(valid_targets); 368 free(valid_targets);
369 return result; 369 return result;
370 } 370 }
OLDNEW
« no previous file with comments | « src/trusted/validator_ragel/unreviewed/validator_x86_32.rl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698