-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Please include the following in your bug report:
Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.51 (c0c2ca1314672a25699846b4663701bcb6f69cca)
clang version 18.0.0git (https://github.com/llvm/llvm-project f2464ca317bfeeedddb7cbdea3c2c8ec487890bb)
Target: wasm32-unknown-emscripten
Thread model: posix
Failing command line in full:
N/A
Full link command and output with -v appended:
--bind -sENVIRONMENT=shell,web -sSINGLE_FILE=1 -sWASM=1 -sMAXIMUM_MEMORY=4GB -sALLOW_MEMORY_GROWTH=1 -sWASM_ASYNC_COMPILATION=0 -sEXPORTED_FUNCTIONS="['_malloc', '_free']" -O0 --extern-post-js post.js
I encountered an error: Uncaught ReferenceError: upper is not defined when attempting to load the compiled wasm module. This issue arises from the auto-generated uuid_unparse function, which is missing the upper argument. The problematic portion of the code looks like this:
/** @param {number|boolean=} upper */ function _uuid_unparse(uu, out) {
uu >>>= 0;
out >>>= 0;
var i = 0;
var uuid = "xxxx-xx-xx-xx-xxxxxx".replace(/[x]/g, function(c) {
var r = upper ? (HEAPU8[(((uu) + (i)) >>> 0) >>> 0]).toString(16).toUpperCase() : (HEAPU8[(((uu) + (i)) >>> 0) >>> 0]).toString(16);
r = (r.length === 1) ? "0" + r : r;
i++;
return r;
});
stringToUTF8(uuid, out, 37);
}I noticed that when I compiled using version 3.1.37, the correct function signature includes the upper parameter:
function _uuid_unparse(uu, out, upper) {
var i = 0;
var uuid = "xxxx-xx-xx-xx-xxxxxx".replace(/[x]/g, function(c) {
var r = upper ? HEAPU8[uu + i >>> 0].toString(16).toUpperCase() : HEAPU8[uu + i >>> 0].toString(16);
r = r.length === 1 ? "0" + r : r;
i++;
return r;
});
stringToUTF8(uuid, out, 37);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels