Repository navigation
Assert that ReadBinaryIr is not used with skip_function_bodies - #2817
Conversation
|
I think Maybe better to simply declare |
|
(Something like #2816 maybe) |
Skipping the bodies steps over the end marker that would close each function's label, so EndFunctionBody reports the body as missing its end marker and reading fails for any module with a function in it. The option was only ever meant for the objdump reader, so declare it unsupported here rather than teaching the IR reader to work around it.
7be68fb to
5240478
Compare
|
That makes sense, switched it over — the diff is now just the comment and the assert in ReadBinaryIr, following #2816. Dropped my change to the reader and the test that went with it, and retitled accordingly. Nothing in the tree passes the option to ReadBinaryIr, so nothing starts tripping it. One thing worth flagging rather than quietly dropping: the person who filed #2534 was using it to skip bodies when loading large modules, so asserting closes that off rather than giving them a path. Not arguing against it — the option clearly was not designed for this reader — just noting it in case you would rather it grew a supported route one day. Either way #2534 can be closed as not supported here. |
ReadBinaryIrfails on any module that has a function in it onceskip_function_bodiesis set. Reading sqlite (built with emscripten) both ways:34 is just its first non-imported function, so it gives up on the first body it reaches.
BeginFunctionBodypushes a label for the function, but with bodies skipped the reader steps straight over the body and theendthat would pop that label never arrives.EndFunctionBodythen sees it still sitting on the stack and reports the body as missing its end marker.The option was only ever meant for the objdump reader, which doesn't build a module, so this declares it unsupported here instead of teaching the IR reader to work around it, along the lines of #2816. Nothing in the tree passes it to
ReadBinaryIrtoday, so nothing starts asserting.Fixes #2534.