HaxeFoundation / hxcpp

Runtime files for c++ backend for haxe
Other
298 stars 189 forks source link

Fix endless recursion in Class_obj::GetInstanceFields #1027

Closed profelis closed 1 year ago

profelis commented 1 year ago

cpp::Pointer.mSuper points to same cpp::Pointer instance

Steps to reproduce:

  1. get this repo and build debug sample https://github.com/foreignsasquatch/raylib-hx/tree/main/examples
  2. add breakpoint inside while loop https://github.com/foreignsasquatch/raylib-hx/blob/main/examples/BasicWindow.hx#L12
  3. start debugger session in vscode

stacktrace https://gist.github.com/profelis/390f80bc47afc16f41b3afced4896cc6

Simn commented 1 year ago

I don't really understand how a pointer relation like this happens in the first place, but this kind of check is usually a good idea anyway, so I'm happy to merge it.