Skip to content

options skip_function_bodies can not work with ReadBinaryIr #2534

Open
@primstar-cool

Description

@primstar-cool
wabt::ReadBinaryOptions options;
    options.skip_function_bodies = true;

wabt::Result errorCode = wabt::ReadBinaryIr("", wasmData, fileSize, options, &errors,
&module);

will got an assert
at function [Result BinaryReaderIR::EndFunctionBody(Index index)]
of file
[binary-reader-ir.cc]

the reason is: PushLabel at BinaryReaderIR::BeginFunctionBody, but not consume it when 'skip_function_bodies' turns on.

I think it should add a Step names SkipExpr or trans options on BeginFunctionBody.

BTW, i got another problem, when parse a big wasm in Android, it will crash randomly when parse function code, but same code work well in MacOS. when i skip_function_bodies, it works well.
i will provide detail later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions