UBSAN: Add __ubsan_handle_nonnull_arg

This commit is contained in:
apio 2023-04-07 11:53:19 +02:00
parent 8e8706be27
commit a9b5cf99f7
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 12 additions and 0 deletions

View File

@ -70,5 +70,11 @@ namespace UBSAN
{
SourceLocation location;
};
struct NonnullArgInfo
{
SourceLocation location;
SourceLocation attr_location;
};
}
}

View File

@ -118,4 +118,10 @@ extern "C"
};
__ubsan_handle_type_mismatch(&info, pointer);
}
void __ubsan_handle_nonnull_arg(NonnullArgInfo* info, intptr_t)
{
dbgln("ubsan: null argument at %s:%d:%d", DISPLAY(info->location));
ub_panic();
}
}