diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-05-31 09:10:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-31 09:10:52 +0100 |
| commit | d52aa3f2c22362f417e440e988e186f683449261 (patch) | |
| tree | 157e3aa93bf15cd892fcc03ca8d1c6a4436e5df6 | |
| parent | 53a8fac6ad0d6aacf02a9a338cf89369d33046e8 (diff) | |
| parent | edba218a7c25c39432040176f4c7ea78a9d72958 (diff) | |
Merge pull request #5245 from TheTophatDemon/fix-odin-js-loadcstring
Fix odin.js loadCstring to use pointer address correctly.
| -rw-r--r-- | core/sys/wasm/js/odin.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/sys/wasm/js/odin.js b/core/sys/wasm/js/odin.js index d5faa5210..37a57a59d 100644 --- a/core/sys/wasm/js/odin.js +++ b/core/sys/wasm/js/odin.js @@ -110,16 +110,12 @@ class WasmMemoryInterface { } loadCstring(ptr) { - return this.loadCstringDirect(this.loadPtr(ptr)); - } - - loadCstringDirect(start) { - if (start == 0) { + if (ptr == 0) { return null; } let len = 0; - for (; this.mem.getUint8(start+len) != 0; len += 1) {} - return this.loadString(start, len); + for (; this.mem.getUint8(ptr+len) != 0; len += 1) {} + return this.loadString(ptr, len); } storeU8(addr, value) { this.mem.setUint8 (addr, value); } |