<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/134796>134796</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Bytecode interpreter: Crash with invalid base casts
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            clang:bytecode
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          tbaederr
      </td>
    </tr>
</table>

<pre>
    See:
```c++
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()`.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxMUkFv8ygQ_TXjy6gRGYxtDj44yWavlXLYM4ZpzIqYCEi6_fcrkrRfJST78Wbe87yxydmfV-YR1A7UoTG3ssQ0ltmw45SaObqv8cQMcgIxQSeexwLt6hFTLulmC-6hrwjRrwUNyAqgPzxfXjUn_C6ycc2F_7smPAENQPqHQXxcDHugCUiXxWcg_QbyL4MgD7ilpyRW8V8WvxQxv-y_PxbE9A-jiytQX9B5c15jZiwLo1_vJniH1uSCHyleEDpxqt6dwBIr2r-QWR36amIc2mTygn6t_Hv0a-FUA5KTz0fPwT2Hql2fi7cL-ozWhMAO797Upr-5vJe0M5nf4_WnetO4UTottWl43PZtK7SSippl1L3WQyuU0f2stkPfKtFpsnJwshVGU-NHEqREKwbRKaVoo43plJXDR-vqpYNW8MX4sAnhftnEdG58zjcet7LtddcEM3PIj7-AyAaznkFOHymuhVcHRED7X8T8VdhGx5VQhyaNVfRtvp0ztCL4XPIfm-JL4HH36sBHWNfEz8hw_0jy05flZxezyfxYSG5uKYxLKddc06Uj0PHsy3KbNzZegI7V4_V4u6b4L9sCdHzMlYGOr9HuI_0fAAD__7y725Q">