Commit 2a59507
committed
fix(runtime): populate globals and memories during instantiation
- Add populate_globals_from_module() to copy globals from module to instance
- Add populate_memories_from_module() to copy memories from module to instance
- Use Vec instead of BoundedVec for instance collections in std mode
to avoid serialization overhead and the MemoryWrapper::from_bytes panic
- Update memory/global/table accessor methods for Vec vs BoundedVec API
- Call population methods during instantiation in CapabilityAwareEngine
- Add tracing debug output for instantiation and memory operations
The global "Failed to get global from instance" error is now fixed.
Memory writes now work correctly until an invalid address calculation
(0xFFFFFFD0) occurs in the WASM code itself.1 parent b86de62 commit 2a59507
File tree
3 files changed
+243
-66
lines changed- wrt-runtime/src
- engine
3 files changed
+243
-66
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| |||
514 | 518 | | |
515 | 519 | | |
516 | 520 | | |
517 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
518 | 524 | | |
519 | | - | |
520 | | - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
521 | 529 | | |
522 | | - | |
523 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
524 | 534 | | |
525 | | - | |
526 | | - | |
527 | | - | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
528 | 542 | | |
529 | 543 | | |
530 | 544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
1077 | | - | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1078 | 1091 | | |
1079 | 1092 | | |
1080 | 1093 | | |
| |||
0 commit comments