Michael137 added a comment.

Doing this instead:

  if (const EnumType *enum_type = 
llvm::dyn_cast<EnumType>(qt.getTypePtr()->getUnqualifiedDesugaredType())) {

resolves the crash, though unclear if that's the right thing to do

In D81471#3666071 <https://reviews.llvm.org/D81471#3666071>, @Michael137 wrote:

> This seems to cause issues when `var->getType() == const 
> llvm::APFloatBase::roundingMode`.
>
> The following assertion triggered:
>
>   Assertion failed: (type->isIntegerType() && "Illegal type in 
> IntegerLiteral"), function IntegerLiteral, file Expr.cpp, line 892
>
> Reproduces with:
>
> 1. `lldb -- ./bin/lldb a.out`
> 2. `b LookupLocalVariable`
> 3. step a couple of times until `decl_context` is declared
> 4. `p decl_context`
>
> It looks ike the `dyn_cast` to `EnumType` fails and thus 
> `qt.getUnqualifiedType()` which we pass into `IntegerLiteral::Create` remains 
> an EnumType, which breaks the invariant
>
> Investigating further...

Tried to address this in https://reviews.llvm.org/D130213


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81471/new/

https://reviews.llvm.org/D81471

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to