-
Notifications
You must be signed in to change notification settings - Fork 13.4k
release/19.x: [lld][WebAssembly] Fix use of uninitialized stack data with --wasm64 (#107780) #119723
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
Conversation
@dschuff What do you think about merging this PR to the release branch? |
@llvm/pr-subscribers-lld Author: None (llvmbot) ChangesBackport 5c8fd1e Requested by: @nikic Full diff: https://github.com/llvm/llvm-project/pull/119723.diff 1 Files Affected:
diff --git a/lld/wasm/SyntheticSections.cpp b/lld/wasm/SyntheticSections.cpp
index f02f55519a2512..72d08b849d8e86 100644
--- a/lld/wasm/SyntheticSections.cpp
+++ b/lld/wasm/SyntheticSections.cpp
@@ -587,8 +587,7 @@ void ElemSection::writeBody() {
initExpr.Inst.Value.Global = WasmSym::tableBase->getGlobalIndex();
} else {
bool is64 = config->is64.value_or(false);
- initExpr.Inst.Opcode = is64 ? WASM_OPCODE_I64_CONST : WASM_OPCODE_I32_CONST;
- initExpr.Inst.Value.Int32 = config->tableBase;
+ initExpr = intConst(config->tableBase, is64);
}
writeInitExpr(os, initExpr);
|
@llvm/pr-subscribers-lld-wasm Author: None (llvmbot) ChangesBackport 5c8fd1e Requested by: @nikic Full diff: https://github.com/llvm/llvm-project/pull/119723.diff 1 Files Affected:
diff --git a/lld/wasm/SyntheticSections.cpp b/lld/wasm/SyntheticSections.cpp
index f02f55519a2512..72d08b849d8e86 100644
--- a/lld/wasm/SyntheticSections.cpp
+++ b/lld/wasm/SyntheticSections.cpp
@@ -587,8 +587,7 @@ void ElemSection::writeBody() {
initExpr.Inst.Value.Global = WasmSym::tableBase->getGlobalIndex();
} else {
bool is64 = config->is64.value_or(false);
- initExpr.Inst.Opcode = is64 ? WASM_OPCODE_I64_CONST : WASM_OPCODE_I32_CONST;
- initExpr.Inst.Value.Int32 = config->tableBase;
+ initExpr = intConst(config->tableBase, is64);
}
writeInitExpr(os, initExpr);
|
@dschuff For backport PRs, please rebase instead of merge. They do not use squash merge. |
Can this PR be merged? |
Yes. I don't see any concerns not merging. Note that merging of the release branch is handled by the release manager, which is different from the main branch. |
…lvm#107780) In the case of `--wasm64` we were setting the type of the init expression to be 64-bit but were only setting the low 32-bits of the value (by assigning to Int32). Fixes: emscripten-core/emscripten#22538 (cherry picked from commit 5c8fd1e)
@nikic (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. |
Backport 5c8fd1e
Requested by: @nikic