Showing the changes to src/vm/execution_table.cpp (1 of 10 files). Show all
Unified · Split
| @@ -846,7 +846,7 @@ namespace · 845 unmodified lines | ||
| 846 | 846 | |
| 847 | 847 | auto index = vt_ref<word_t>(r.dest); |
| 848 | 848 | if (index < 0 || arr->get_length() <= index) |
| 849 | − throw out_of_range_memory{ 0, arr->get_length(), index }; | |
| 849 | + throw index_out_of_range_memory{ 0, arr->get_length(), index }; | |
| 850 | 850 | |
| 851 | 851 | // Return the address, not the value |
| 852 | 852 | pt_ref(r.mid) = arr->at(index); |
| @@ -1577,6 +1577,10 @@ namespace · 724 unmodified lines | ||
| 1577 | 1577 | |
| 1578 | 1578 | const auto &function_ref = target_module_ref->get_function_ref(import_function_id); |
| 1579 | 1579 | |
| 1580 | + // Spawning a built-in module is not permitted | |
| 1581 | + if (target_module_ref->is_builtin_module()) | |
| 1582 | + throw vm_user_exception{ "Spawning a built-in module is not permitted" }; | |
| 1583 | + | |
| 1580 | 1584 | vm.fork(r.thread, *target_module_ref, *spawned_frame, function_ref.entry_pc); |
| 1581 | 1585 | |
| 1582 | 1586 | // After the new thread is forked pop off the argument passing frame. |
| @@ -1685,7 +1689,7 @@ namespace · 102 unmodified lines | ||
| 1685 | 1689 | auto imported_module = std::shared_ptr<const vm_module_t>{}; |
| 1686 | 1690 | |
| 1687 | 1691 | // Handle self loading module optimization. |
| 1688 | − if (::strcmp(str->str(), "$self") == 0) | |
| 1692 | + if (std::strcmp(str->str(), "$self") == 0) | |
| 1689 | 1693 | { |
| 1690 | 1694 | imported_module = r.module_ref->module; |
| 1691 | 1695 | } |