Git Product home page Git Product logo

Comments (4)

pchickey avatar pchickey commented on August 23, 2024

Oh! I know this one. The icall implementation is incorrect at the moment, and we fail a spec test that demonstrates this exact issue. When we expand the icall instruction, we check the type index at the call site with the type index of the callee. The problem is, multiple type indices can have the same structural type - the $early_fn type will be assigned to $fn0, which will be a different index than $fnT0 .

Full spec test compliance is important to us. I think we will achieve it within the next month or two. This issue is pretty isolated from the engineering we're doing to fix the rest of the major spec compliance issues, so I should be able to get a fix in pretty soon.

from lucet.

awortman-fastly avatar awortman-fastly commented on August 23, 2024

What commit were you on when you ran into this issue? I was somewhat surprised to find this works on master, since there are related spec tests we don't currently pass.

This:

(module $calli

  (table funcref (elem $fn0))

  (type $fnT0 (func (param i32) (result i32)))
  (type $fnT1 (func (param i32) (result i32)))

  (func $fn0 (param $arg i32) (result i32) (i32.const 0))

  (func $main0 (drop (call_indirect (type $fnT1) (i32.const 0) (i32.const 0))))

  (export "_start" (func $main0))
)

does still erroneously claim BadSignature, and that's definitely due to us not checking structural equivalence between $fnT0 and $fnT1. But it's also not the same code you reported :) I'm left wondering what's different that your example seems to run without issue when I tested it..

from lucet.

kanaka avatar kanaka commented on August 23, 2024

I don't have access to the system where I produced this but I checked out lucet an hour or two before I filed the bug (i.e. yesterday). If you aren't seeing it then I expect it is dependent on the wat -> wasm compiler behavior. I'm using wasm-as from binaryen and I'll have to get access to my home workstation before I can figure out what version it is.

from lucet.

pchickey avatar pchickey commented on August 23, 2024

lucetc can accept wat syntax directly, and translates it to wasm using the wabt package's translator (also available as the wat2wasm executable. So, its probably a difference in how those two translators work.

from lucet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.