forked from OSchip/llvm-project
Make the InvalidValueData take a SourceLocation.
llvm-svn: 191807
This commit is contained in:
parent
bfcff68516
commit
b7aa592c19
|
@ -246,15 +246,16 @@ void __ubsan::__ubsan_handle_float_cast_overflow_abort(
|
|||
|
||||
void __ubsan::__ubsan_handle_load_invalid_value(InvalidValueData *Data,
|
||||
ValueHandle Val) {
|
||||
// TODO: Add deduplication once a SourceLocation is generated for this check.
|
||||
Diag(getCallerLocation(), DL_Error,
|
||||
SourceLocation Loc = Data->Loc.acquire();
|
||||
if (Loc.isDisabled())
|
||||
return;
|
||||
|
||||
Diag(Loc, DL_Error,
|
||||
"load of value %0, which is not a valid value for type %1")
|
||||
<< Value(Data->Type, Val) << Data->Type;
|
||||
}
|
||||
void __ubsan::__ubsan_handle_load_invalid_value_abort(InvalidValueData *Data,
|
||||
ValueHandle Val) {
|
||||
Diag(getCallerLocation(), DL_Error,
|
||||
"load of value %0, which is not a valid value for type %1")
|
||||
<< Value(Data->Type, Val) << Data->Type;
|
||||
__ubsan_handle_load_invalid_value(Data, Val);
|
||||
Die();
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ struct FloatCastOverflowData {
|
|||
RECOVERABLE(float_cast_overflow, FloatCastOverflowData *Data, ValueHandle From)
|
||||
|
||||
struct InvalidValueData {
|
||||
// FIXME: SourceLocation Loc;
|
||||
SourceLocation Loc;
|
||||
const TypeDescriptor &Type;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue