Ensure that the variant returned by member->getValue() has a value and
is not Empty. Failure to do so will trigger an assertion failure in
llvm::pdb::Variant::getBitWidth(). This can occur when the static
member is a forward declaration.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for tackling this! Yes, I hit it as well during development and wondered what is the right thing to do. The effect of the proposed change will be log messages like this right?
... which resolves to a constant value of mismatched width (-1 bits). Ignoring constant.
I think it would be great to log the actual issue (constant width not accessible) and bail out if value.Type == llvm::pdb::Empty. Even before requesting qual_type. What do you think?
lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp | ||
---|---|---|
1307 | Is the -1 intended to express an invalid value? Maybe this should become a signed int then? |
No, it should be something like 4294967295 bits. Assuming that you have that log enabled.
I think it would be great to log the actual issue (constant width not accessible) and bail out if value.Type == llvm::pdb::Empty. Even before requesting qual_type. What do you think?
Sure, I can test that and see if there are any adverse effects from that.
lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp | ||
---|---|---|
1307 | Yeah, by means of it being impossibly large. I suppose I could do an explicit cast (i.e. static_cast<unsigned>(-1) to make this clearer. |
Is the -1 intended to express an invalid value? Maybe this should become a signed int then?