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

Side by Side Diff: syzygy/agent/asan/shadow.cc

Issue 2526563002: Add a target to run the SyzyAsan RTL unittests in 4G (Closed)
Patch Set: Address nits. Created 4 years 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
« no previous file with comments | « syzygy/agent/asan/shadow.h ('k') | syzygy/agent/asan/static_shadow.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 Google Inc. All Rights Reserved. 1 // Copyright 2012 Google Inc. All Rights Reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 DCHECK_NE(static_cast<size_t*>(nullptr), index); 88 DCHECK_NE(static_cast<size_t*>(nullptr), index);
89 DCHECK_NE(static_cast<uint8_t*>(nullptr), mask); 89 DCHECK_NE(static_cast<uint8_t*>(nullptr), mask);
90 90
91 size_t i = reinterpret_cast<uintptr_t>(address) / kPageSize; 91 size_t i = reinterpret_cast<uintptr_t>(address) / kPageSize;
92 *index = i / 8; 92 *index = i / 8;
93 *mask = 1 << (i % 8); 93 *mask = 1 << (i % 8);
94 } 94 }
95 95
96 } // namespace 96 } // namespace
97 97
98 extern "C" {
99 // Provides a dummy static shadow memory array. This is simply to be used as
100 // a pointer for the probes to be anchored to. If any of the probes referring
101 // to this dummy shadow memory are run they will behave badly until they have
102 // been patched using 'PatchMemoryInterceptorShadowReferences'.
103 uint8_t asan_memory_interceptors_shadow_memory[1] = {};
104 }
105
98 Shadow::Shadow() : own_memory_(false), shadow_(nullptr), length_(0) { 106 Shadow::Shadow() : own_memory_(false), shadow_(nullptr), length_(0) {
99 Init(RequiredLength()); 107 Init(RequiredLength());
100 } 108 }
101 109
102 Shadow::Shadow(size_t length) 110 Shadow::Shadow(size_t length)
103 : own_memory_(false), shadow_(nullptr), length_(0) { 111 : own_memory_(false), shadow_(nullptr), length_(0) {
104 Init(length); 112 Init(length);
105 } 113 }
106 114
107 Shadow::Shadow(void* shadow, size_t length) 115 Shadow::Shadow(void* shadow, size_t length)
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 // Advance the shadow cursor. 1146 // Advance the shadow cursor.
1139 ++shadow_cursor_; 1147 ++shadow_cursor_;
1140 } // while (shadow_cursor_ < end_of_region) 1148 } // while (shadow_cursor_ < end_of_region)
1141 } 1149 }
1142 1150
1143 return false; 1151 return false;
1144 } 1152 }
1145 1153
1146 } // namespace asan 1154 } // namespace asan
1147 } // namespace agent 1155 } // namespace agent
OLDNEW
« no previous file with comments | « syzygy/agent/asan/shadow.h ('k') | syzygy/agent/asan/static_shadow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698