Skip to content

[wasm] Interpreter: Local variable of function pointer type emits a warning Test.Prepare: Store local stack type mismatch 0 7 #65881

Closed

Description

@radical

Warning Test.Prepare: Store local stack type mismatch 0 7 from

g_warning("%s.%s: Store local stack type mismatch %d %d",
m_class_get_name (td->method->klass), td->method->name,
stack_type [mt], td->sp [-1].type);

  1. Put this code in src/mono/sample/wasm/console-v8-cjs/Program.cs
using System;
using System.Threading.Tasks;

public class Test
{
    public static async Task<int> Main(string[] args)
    {
        await Task.Delay(1);
        Prepare();
        return 0;
    }

    public unsafe static int Prepare()
    {
        delegate*<int> value = &Prepare;
        Console.WriteLine ($"value is {value == null}");
        return 5;
    }
}
  1. build: make build MSBUILD_ARGS="-p:TreatWarningsAsErrors=false"
  2. make run

Output:

console.debug: mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
[MONO] Test.Prepare: Store local stack type mismatch 0 7
value is False

IIUC,

static int
can_store (int st_value, int vt_value)
{
if (st_value == STACK_TYPE_O || st_value == STACK_TYPE_MP)
st_value = STACK_TYPE_I;
if (vt_value == STACK_TYPE_O || vt_value == STACK_TYPE_MP)
vt_value = STACK_TYPE_I;
return st_value == vt_value;
}

.. this needs to map STACK_TYPE_F to STACK_TYPE_I too.

cc @lambdageek @BrzVlad

Activity

  1. ghost added
    untriaged
    on Feb 25, 2022
  2. added
    disabled-test
    on Feb 25, 2022
  3. added this to the 7.0.0 milestone on Feb 25, 2022
  4. lewing commented on Mar 10, 2022

    @lewing
    Member
  5. BrzVlad commented on Mar 10, 2022

    @BrzVlad
    Member

    isn't this fixed by #65917 ? This PR maybe asserts too aggressively however.

  6. ghost added
    in-pr
    on Mar 17, 2022
  7. removed
    untriaged
    on Mar 17, 2022
  8. ghost removed
    in-pr
    on Mar 21, 2022
  9. ghost locked as resolved and limited conversation to collaborators on Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-Codegen-Interpreter-monodisabled-test

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions