Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the 32 bit variant of x86 to generate a target machine for inkwell #2436

Merged
merged 1 commit into from
Jun 21, 2021

Conversation

MidasLamb
Copy link
Contributor

Extended the match on X86_64 to include the X86_32 and all of its
architectures.

This allows the following program to run on a 32 bit windows VM:

fn main() -> Result<(), Box<dyn std::error::Error>> {
    use wasmer::{imports, Instance, Module, Store, Value};

    let module_wat = r#"
    (module
    (type $t0 (func (param i32) (result i32)))
    (func $add_one (export "add_one") (type $t0) (param $p0 i32) (result i32)
        get_local $p0
        i32.const 1
        i32.add))
    "#;

    let store = Store::default();
    let module = Module::new(&store, &module_wat)?;
    // The module doesn't import anything, so we create an empty import object.
    let import_object = imports! {};
    let instance = Instance::new(&module, &import_object)?;

    let add_one = instance.exports.get_function("add_one")?;
    let result = add_one.call(&[Value::I32(42)])?;
    assert_eq!(result[0], Value::I32(43));

    dbg!(&result[0]);
    Ok(())
}

Extended the match on X86_64 to include the X86_32 and all of its
architectures.
@MidasLamb MidasLamb requested a review from losfair as a code owner June 20, 2021 19:06
@syrusakbary
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 21, 2021

@bors bors bot merged commit 7ddf61a into wasmerio:master Jun 21, 2021
@syrusakbary syrusakbary added this to the v2.1 milestone Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants