summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2014-10-23 16:50:51 -0700
committerChih-Hung Hsieh <chh@google.com>2014-10-23 16:50:51 -0700
commita1ff475b07dd7c8a2dfa0e83bc2a25ef159b6152 (patch)
tree9ebb0e3dae4c6942627d7e5a2b1fcc7071a156a4
parent5bea7edddd1bca0f94b08f3fb7aefab1c3021e17 (diff)
downloadsystem_core-a1ff475b07dd7c8a2dfa0e83bc2a25ef159b6152.zip
system_core-a1ff475b07dd7c8a2dfa0e83bc2a25ef159b6152.tar.gz
system_core-a1ff475b07dd7c8a2dfa0e83bc2a25ef159b6152.tar.bz2
Add volatile to avoid clang optimization.
BUG: 18108178 Change-Id: Ie5b8b1808fcf6d1eacc14a7c6ac0c8d49641fec2
-rw-r--r--debuggerd/crasher.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/debuggerd/crasher.c b/debuggerd/crasher.c
index d315ee5..d0c3912 100644
--- a/debuggerd/crasher.c
+++ b/debuggerd/crasher.c
@@ -59,7 +59,7 @@ static void *noisy(void *x)
for(;;) {
usleep(250*1000);
write(2, &c, 1);
- if(c == 'C') *((unsigned*) 0) = 42;
+ if(c == 'C') *((volatile unsigned*) 0) = 42;
}
return NULL;
}