Fixed a bug in gen/tollvm.cpp.

This commit is contained in:
Jernej Krempuš
2012-08-05 17:34:03 +02:00
committed by David Nadlinger
parent 5216fa48d8
commit 3d108ee684

View File

@@ -596,7 +596,7 @@ LLConstant* DtoConstFP(Type* t, longdouble value)
else if(llty == LLType::getX86_FP80Ty(gIR->context())) {
uint64_t bits[] = {0, 0};
bits[0] = *reinterpret_cast<uint64_t*>(&value);
bits[1] = *reinterpret_cast<uint16_t*>(reinterpret_cast<uint64_t*>(&value + 1));
bits[1] = *reinterpret_cast<uint16_t*>(reinterpret_cast<uint64_t*>(&value) + 1);
return LLConstantFP::get(gIR->context(), APFloat(APInt(80, 2, bits)));
} else {
assert(0 && "Unknown floating point type encountered");