summaryrefslogtreecommitdiffstats
path: root/commands/ubsan.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/ubsan.c')
-rw-r--r--commands/ubsan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/commands/ubsan.c b/commands/ubsan.c
index 784678d399..4a9716139c 100644
--- a/commands/ubsan.c
+++ b/commands/ubsan.c
@@ -1,4 +1,5 @@
-// SPDX-License-Identifier: GPL-2.0
+// SPDX-License-Identifier: GPL-2.0-only
+
#include <common.h>
#include <command.h>
#include <abort.h>
@@ -101,6 +102,8 @@ static void test_ubsan_object_size_mismatch(void)
volatile long long *ptr, val2;
ptr = (long long *)&val;
+ OPTIMIZER_HIDE_VAR(ptr);
+
val2 = *ptr;
}