BinaryenAddFunctionImport lost internalName on export, is this intentional?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start at the implementation of BinaryenAddFunctionImport shown in the issue and compare it with BinaryenAddFunction, then inspect how BinaryenGetFunction and export naming use internalName. Verify the current behavior for imported functions and determine what API behavior or naming preservation should be covered before adding a focused regression test.
Written by the indexing model from the issue text.
Description
BinaryenAddFunctionImport(module, internalName, "env", "externalBaseName", params, result);
BinaryenFunctionRef func = BinaryenGetFunction(module, ret);
func->setExplicitName(internalName);
i think add and Get , It's a bit wasteful. why not return BinaryenFunctionRef on BinaryenAddFunctionImport?
i find that, BinaryenAddFunction directly setExplicitName. why not BinaryenAddFunctionImport?
void BinaryenAddFunctionImport(BinaryenModuleRef module,
const char* internalName,
const char* externalModuleName,
const char* externalBaseName,
BinaryenType params,
BinaryenType results) {
auto* func = ((Module*)module)->getFunctionOrNull(internalName);
if (func == nullptr) {
auto func = std::make_unique<Function>();
if (internalName)
func->setExplicitName(internalName);
func->name = internalName;
func->module = externalModuleName;
func->base = externalBaseName;
// TODO: Take a HeapType rather than params and results.
func->type = Signature(Type(params), Type(results));
((Module*)module)->addFunction(std::move(func));
} else {
// already exists so just set module and base
func->module = externalModuleName;
func->base = externalBaseName;
}
}
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 77
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WebAssembly/binaryen
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
WebAssembly/binaryen#9135 · 1 comment ·
-
Difficulty 2/5 Half a day Newbie friendliness 76/100
WebAssembly/binaryen#9018 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
WebAssembly/binaryen#9133 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
WebAssembly/binaryen#9123 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WebAssembly/binaryen#9122 ·
All issues in WebAssembly/binaryen
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
speaches-ai/speaches#678 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Openbug ecr
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100