Skip to content

Commit

Permalink
[Darwin][UBSan][Sanitizer] abort_on_error ubsan test fix for arm64
Browse files Browse the repository at this point in the history
The current darwin abort_on_error test specifically tests for a division
by zero undefined behavior. However arm does not trap by default for this
behavior. x86 signals the abort, which is why the test passes on x86.
This patch updates the test to test for a case where the ubsan runtime
specifically calls Die() to trigger an abort by default.

rdar://92108564

Differential Revision: https://reviews.llvm.org/D124480
  • Loading branch information
thetruestblue committed Apr 27, 2022
1 parent 82aa5e2 commit 8b574a1
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -16,8 +16,8 @@ int global;

int main() {
#if defined(USING_ubsan)
int value = 5;
int computation = value / 0; // Division by zero.
volatile int *null = 0;
*null = 0;
#else
volatile int *a = new int[100];
delete[] a;
Expand Down

0 comments on commit 8b574a1

Please sign in to comment.