File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -3620,8 +3620,11 @@ static void emitCheckHandlerCall(CodeGenFunction &CGF,
3620
3620
// Add more precise attributes to recoverable ubsan handlers for better
3621
3621
// optimizations.
3622
3622
if (CGF.CGM .getCodeGenOpts ().OptimizationLevel > 0 && MayReturn) {
3623
- B.addMemoryAttr (llvm::MemoryEffects::argMemOnly (llvm::ModRefInfo::Ref) |
3624
- llvm::MemoryEffects::inaccessibleMemOnly ());
3623
+ // __ubsan_handle_dynamic_type_cache_miss reads the vtable, which is also
3624
+ // accessible by the current module.
3625
+ if (CheckHandler != SanitizerHandler::DynamicTypeCacheMiss)
3626
+ B.addMemoryAttr (llvm::MemoryEffects::argMemOnly (llvm::ModRefInfo::Ref) |
3627
+ llvm::MemoryEffects::inaccessibleMemOnly ());
3625
3628
// If the handler does not return, we must hit a undefined behavior.
3626
3629
B.addAttribute (llvm::Attribute::WillReturn);
3627
3630
}
You can’t perform that action at this time.
0 commit comments