Skip to content

Bytecode interpreter: Crash with invalid base casts #134796

Open
@tbaederr

Description

@tbaederr

See:

struct C{
  int a;
};
struct S {
  constexpr S() {
    ((C*)this)->a = 12;
  }
};
constexpr S s;

We don't diagnose the invalid cast from S* to C* and instead crash in Pointer::isField() which is called via GetPtrBasePop().

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:bytecodeIssues for the clang bytecode constexpr interpreterclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions