Skip to content

Commit 75e4438

Browse files
authored
[ubsan] Change "Type mismatch in operation" trap reason to "Alignment, null, or object-size error" (#169752)
I originally proposed this rewording when trap reasons were introduced in #145967 (comment). This was not adopted because there was a counter-proposal to split the enum; however, that work appears to have stalled (#151243). In the meantime, there has been an additional datapoint that the current wording is confusing to users. Thus, let's reword it now to prevent further confusion.
1 parent 8397945 commit 75e4438

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/CodeGen/SanitizerHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
SANITIZER_CHECK(SubOverflow, sub_overflow, 0, \
6565
"Integer subtraction overflowed") \
6666
SANITIZER_CHECK(TypeMismatch, type_mismatch, 1, \
67-
"Type mismatch in operation") \
67+
"Alignment, null, or object-size error") \
6868
SANITIZER_CHECK(AlignmentAssumption, alignment_assumption, 0, \
6969
"Alignment assumption violated") \
7070
SANITIZER_CHECK( \

clang/test/DebugInfo/Generic/ubsan-trap-reason-type-mismatch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ int type_mismatch(int *p) { return *p; }
66
// CHECK-LABEL: @type_mismatch
77
// CHECK: call void @llvm.ubsantrap(i8 22) {{.*}}!dbg [[LOC:![0-9]+]]
88
// CHECK: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}})
9-
// CHECK: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$Type mismatch in operation"
9+
// CHECK: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$Alignment, null, or object-size error"

0 commit comments

Comments
 (0)