File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -231,17 +231,25 @@ static FakeStack* GetFakeStack() {
231231}
232232
233233static FakeStack* GetFakeStackFast () {
234- if (FakeStack* fs = GetTLSFakeStack ())
234+ FakeStack* fs = GetTLSFakeStack ();
235+ if (LIKELY (fs))
235236 return fs;
236237 if (!__asan_option_detect_stack_use_after_return)
237238 return nullptr ;
238- return GetFakeStack ();
239+ fs = GetFakeStack ();
240+ if (LIKELY (fs))
241+ SetTLSFakeStack (fs);
242+ return fs;
239243}
240244
241245static FakeStack* GetFakeStackFastAlways () {
242- if (FakeStack* fs = GetTLSFakeStack ())
246+ FakeStack* fs = GetTLSFakeStack ();
247+ if (LIKELY (fs))
243248 return fs;
244- return GetFakeStack ();
249+ fs = GetFakeStack ();
250+ if (LIKELY (fs))
251+ SetTLSFakeStack (fs);
252+ return fs;
245253}
246254
247255static ALWAYS_INLINE uptr OnMalloc (uptr class_id, uptr size) {
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ class FakeStack {
195195 void *true_start;
196196};
197197
198- void SetTLSFakeStack (FakeStack * fs);
198+ void SetTLSFakeStack (FakeStack* fs);
199199
200200} // namespace __asan
201201
You can’t perform that action at this time.
0 commit comments