Skip to content

[JuliaSyntax] core_parser_hook returns the last_offset as a UInt32 on 32 bit systems, breaking jl_parse #60417

@xal-0

Description

@xal-0

@fatteneder encountered this while embedding 32 bit Julia. jl_eval_string ceases to work at all if the JuliaSyntax parser has been enabled, because jl_parse expects the return value of Core._parse to use a C long for the offset:

    JL_TYPECHK(parse, expr, jl_svecref(result, 0));
    JL_TYPECHK(parse, long, jl_svecref(result, 1));

Compare JuliaSyntax.last_byte on x86_64:

julia> Base.infer_return_type(Base.JuliaSyntax.last_byte, (Base.JuliaSyntax.ParseStream,))
Int64

vs x86:

julia> Base.infer_return_type(Base.JuliaSyntax.last_byte, (Base.JuliaSyntax.ParseStream,))
UInt32

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorparserLanguage parsing and surface syntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions