Browse Source
* handle interface functions correctly in `component::Linker::func_new` Many months ago, I implemented `func_new`, but only supporting top-level function imports. If you tried to link a host function under an imported interface, it would mistakenly treat it as a top-level function and either error out if it couldn't find a corresponding type definition in the passed `&Component`; or, if it found a top-level function that happened to have the same name, it would use that type (which would coincidentally work if the type happens to match, but lead to a runtime error later on otherwise). This fixes the issue by looking up the correct component instance when necessary and getting the type from there. Note I've made no effort to optimize for performance here. Happy to revisit that if there's a need. Signed-off-by: Joel Dice <joel.dice@fermyon.com> * print names in `func_new`, not intern indexes Signed-off-by: Joel Dice <joel.dice@fermyon.com> * use `Vec` instead of linked list in `LinkerInstance` Signed-off-by: Joel Dice <joel.dice@fermyon.com> --------- Signed-off-by: Joel Dice <joel.dice@fermyon.com> Co-authored-by: Alex Crichton <alex@alexcrichton.com>pull/6697/head
Joel Dice
1 year ago
committed by
GitHub
2 changed files with 149 additions and 13 deletions
Loading…
Reference in new issue