karelklic / canal

Abstract interpreter for real-world application programs
https://github.com/karelklic/canal/wiki
Other
32 stars 2 forks source link

std::bad_cast thrown in fcmp #52

Closed xbrukner closed 12 years ago

xbrukner commented 12 years ago
%37 = load double* %s, align 8
%38 = fcmp ole double 0.000000e+00, %37
(canal) 
/home/tomas/projekty/canal/lib/Utils.h:159(dynCast) fatal error: std::bad_cast
[bt]: (1) /home/tomas/projekty/canal/lib/libcanal.so : Canal::Integer::Container const& Canal::dynCast<Canal::Integer::Container const&, Canal::Domain>(Canal::Domain const&)+0xb6 [0x3a2ce7]
[bt]: (2) /home/tomas/projekty/canal/lib/libcanal.so : +0xa60ae [0x3b30ae]
[bt]: (3) /home/tomas/projekty/canal/lib/libcanal.so : Canal::Integer::Container::fcmp(Canal::Domain const&, Canal::Domain const&, llvm::CmpInst::Predicate)+0x38 [0x3b32e0]
[bt]: (4) /home/tomas/projekty/canal/lib/libcanal.so : Canal::Operations::cmpOperation(llvm::CmpInst const&, Canal::State&, void (Canal::Domain::*)(Canal::Domain const&, Canal::Domain const&, llvm::CmpInst::Predicate))+0x13c [0x3c708a]
[bt]: (5) /home/tomas/projekty/canal/lib/libcanal.so : Canal::Operations::fcmp(llvm::FCmpInst const&, Canal::State&)+0x3d [0x3c950f]
[bt]: (6) /home/tomas/projekty/canal/lib/libcanal.so : Canal::Operations::interpretInstruction(llvm::Instruction const&, Canal::State&)+0xb0 [0x3c5d06]
[bt]: (7) /home/tomas/projekty/canal/lib/libcanal.so : Canal::InterpreterBlock::Iterator::interpretInstruction()+0x3f [0x3c2d25]
[bt]: (8) /home/tomas/projekty/canal/tool/canal : State::step(int)+0x26 [0x8071448]
[bt]: (9) /home/tomas/projekty/canal/tool/canal : CommandStep::run(std::vector<std::string, std::allocator<std::string> > const&)+0x89 [0x8070fd9]
[bt]: (10) /home/tomas/projekty/canal/tool/canal : Commands::executeLine(std::string const&)+0x222 [0x806ec32]
[bt]: (11) /home/tomas/projekty/canal/tool/canal : main+0x24f [0x8065a33]
[bt]: (12) /lib/i386-linux-gnu/libc.so.6 : __libc_start_main+0xf3 [0x5404d3]
[bt]: (13) /home/tomas/projekty/canal/tool/canal() [0x8065451]

File tests/coreutils/sleep.c

xbrukner commented 12 years ago

IntegerContainer.cpp - cmpOperation - line 406