summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/Lexer.l5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/AsmParser/Lexer.l b/llvm/lib/AsmParser/Lexer.l
index a5cb4eff265..9cfe9fd78e5 100644
--- a/llvm/lib/AsmParser/Lexer.l
+++ b/llvm/lib/AsmParser/Lexer.l
@@ -70,7 +70,10 @@ static double HexToFP(const char *Buffer) {
assert(sizeof(double) == sizeof(Result) &&
"Data sizes incompatible on this target!");
- void *ProxyPointer = &Result; // Break TBAA correctly
+ // Behave nicely in the face of C TBAA rules... see:
+ // http://www.nullstone.com/htmls/category/aliastyp.htm
+ //
+ char *ProxyPointer = (char*)&Result;
return *(double*)ProxyPointer; // Cast Hex constant to double
}
OpenPOWER on IntegriCloud