Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The code to reproduce this is: #include "llvm/Support/YAMLTraits.h" struct T { int a; };
namespace llvm { namespace yaml { template <> struct MappingTraits { static void mapping(llvm::yaml::IO &IO, T &T) { IO.mapOptional("a", T.a); } }; } }
int main(int argc, const char **argv) { llvm::yaml::Input Input(""); T T; Input >> T; return 0; }
$ ./test test: llvm/include/llvm/Support/Casting.h:97: static bool llvm::isa_impl_cl<llvm::yaml::Input::MapHNode, const llvm::yaml::Input::HNode *>::doit(const From *) [To = llvm::yaml::Input::MapHNode, From = const llvm::yaml::Input::HNode *]: Assertion `Val && "isa<> used on a null pointer"' failed. Aborted (core dumped)
The problem is in the line 88 of lib/Support/YAMLTraits.cpp: 88 MapHNode *MN = dyn_cast(CurrentNode);
The text was updated successfully, but these errors were encountered:
I observe the same assertion when compiling a simple .c test with msan:
typedef char int8_t; int8_t a; b; c; int8_t fn1 (p1) { return a < 0 || p1 || 0 > 1 >> p1 ? a : a << p1; } fn2 () { int8_t d; c = fn1 (b << 13); d = c < 0 ? : 0; fn3 (d); }
% clang -c -O3 -g -fsanitize=memory j.c
llvm/include/llvm/Support/Casting.h:97: static bool llvm::isa_impl_cl<llvm::ConstantSDNode, const llvm::SDNode *>::doit(const From *) [To = llvm::ConstantSDNode, From = const llvm::SDNode *]: Assertion `Val && "isa<> used on a null pointer"' failed. 11 clang-3.3 0x0000000000b62eed llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AliasAnalysis&, llvm::CodeGenOpt::Level) + 733 12 clang-3.3 0x0000000000c1f3a7 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 871 13 clang-3.3 0x0000000000c1e7d9 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 6265 14 clang-3.3 0x0000000000c1c2a6 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1302 15 clang-3.3 0x0000000000d6d30d llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 125
Sorry, something went wrong.
I observe the same assertion when compiling a simple .c test with msan: This means there's another wrong usage of isa<> function, but this is an absolutely unrelated issue.
Fixed in r195016.
No branches or pull requests
llvmbot commentedMay 7, 2013
Extended Description
The code to reproduce this is:
#include "llvm/Support/YAMLTraits.h"
struct T { int a; };
namespace llvm {
namespace yaml {
template <> struct MappingTraits {
static void mapping(llvm::yaml::IO &IO, T &T) {
IO.mapOptional("a", T.a);
}
};
}
}
int main(int argc, const char **argv) {
llvm::yaml::Input Input("");
T T;
Input >> T;
return 0;
}
$ ./test
test: llvm/include/llvm/Support/Casting.h:97: static bool llvm::isa_impl_cl<llvm::yaml::Input::MapHNode, const llvm::yaml::Input::HNode *>::doit(const From *) [To = llvm::yaml::Input::MapHNode, From = const llvm::yaml::Input::HNode *]: Assertion `Val && "isa<> used on a null pointer"' failed.
Aborted (core dumped)
The problem is in the line 88 of lib/Support/YAMLTraits.cpp:
88 MapHNode *MN = dyn_cast(CurrentNode);
The text was updated successfully, but these errors were encountered: