[Lldb-commits] [PATCH] D81471: [lldb] Add support for using integral const static data members in the expression evaluator

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 20 17:29:22 PDT 2022


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



More information about the lldb-commits mailing list