Skip to content
This repository was archived by the owner on Jul 7, 2022. It is now read-only.

Conversation

undingen
Copy link
Contributor

Before this change we but everything into namespace 0 (so is_function() always returned true).
cranelift-simplejit/src/backend.rs::get_definition:
calls namespace.is_function(name) to figure out if it has to lookup a function or data definition.
But cranelift-module is_function() does this by comparing the namespace with 0:

    // Return whether `name` names a function, rather than a data object.
    pub fn is_function(&self, name: &ir::ExternalName) -> bool {
        if let ir::ExternalName::User { namespace, .. } = *name {
            namespace == 0
        } else {
            panic!("unexpected ExternalName kind {}", name)
        }
    }

@sunfishcode
Copy link
Owner

This makes sense to me.

Before this change we but everything into namespace 0 (so is_function() always return true).
`cranelift-simplejit/src/backend.rs::get_definition:`
calls `namespace.is_function(name)` to figure out if it has to lookup a function or data definition.
But cranelift-module is_function() does this by comparing the namespace with 0:
```
    // Return whether `name` names a function, rather than a data object.
    pub fn is_function(&self, name: &ir::ExternalName) -> bool {
        if let ir::ExternalName::User { namespace, .. } = *name {
            namespace == 0
        } else {
            panic!("unexpected ExternalName kind {}", name)
        }
    }
```
@undingen undingen marked this pull request as ready for review October 8, 2019 16:21
@undingen
Copy link
Contributor Author

undingen commented Oct 8, 2019

rebased the PR - no other changes

@undingen
Copy link
Contributor Author

is there anything to do to get this merged?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants