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

Calling a function on a dynamic module with lifetime #55

Closed
bvssvni opened this issue Feb 17, 2016 · 0 comments
Closed

Calling a function on a dynamic module with lifetime #55

bvssvni opened this issue Feb 17, 2016 · 0 comments
Assignees
Labels

Comments

@bvssvni
Copy link
Member

bvssvni commented Feb 17, 2016

module.rs:

fn lifetime_1(a, b: 'a) {
    a.b = b
}

loader.rs:

fn main() {
    a := {b: [0]}
    loop {
        b := [2]
        m := load("source/module.dyon")
        call(m, "lifetime_1", [a, b])
        break
    }
    println(a.b)
}

This causes unsafe behavior because the lifetime of b is not checked.

@bvssvni bvssvni added the bug label Feb 17, 2016
@bvssvni bvssvni self-assigned this Jun 23, 2016
bvssvni added a commit to bvssvni/dyon that referenced this issue Jun 23, 2016
Closes PistonDevelopers#55

Perform runtime lifetime checking on arguments when calling a function
on a loaded module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant