Showing the changes to src/vm/execution_table.cpp (1 of 11 files). Show all
Unified · Split
| @@ -773,11 +773,11 @@ namespace · 772 unmodified lines | ||
| 773 | 773 | void _cons(vm_registers_t &r) |
| 774 | 774 | { |
| 775 | 775 | auto tail_maybe = at_val<vm_list_t>(r.dest); |
| 776 | + auto new_list = new vm_list_t{ intrinsic_type_desc::type<PrimitiveType>(), tail_maybe }; | |
| 777 | + | |
| 776 | 778 | if (tail_maybe != nullptr) |
| 777 | 779 | tail_maybe->release(); |
| 778 | 780 | |
| 779 | − auto new_list = new vm_list_t{ intrinsic_type_desc::type<PrimitiveType>(), tail_maybe }; | |
| 780 | − | |
| 781 | 781 | auto value = vt_ref<PrimitiveType>(r.src); |
| 782 | 782 | vt_ref<PrimitiveType>(new_list->value()) = value; |
| 783 | 783 | |
| @@ -792,11 +792,11 @@ namespace · 8 unmodified lines | ||
| 792 | 792 | EXEC_DECL(consp) |
| 793 | 793 | { |
| 794 | 794 | auto tail_maybe = at_val<vm_list_t>(r.dest); |
| 795 | − if (tail_maybe != nullptr) | |
| 796 | − tail_maybe->release(); | |
| 797 | 795 | |
| 798 | 796 | // Create a new list |
| 799 | 797 | auto new_list = new vm_list_t{ intrinsic_type_desc::type<pointer_t>(), tail_maybe }; |
| 798 | + if (tail_maybe != nullptr) | |
| 799 | + tail_maybe->release(); | |
| 800 | 800 | |
| 801 | 801 | auto alloc = at_val<vm_alloc_t>(r.src); |
| 802 | 802 | if (alloc != nullptr) |
| @@ -826,11 +826,11 @@ namespace · 23 unmodified lines | ||
| 826 | 826 | inc_ref_count_in_memory(*type, r.src); |
| 827 | 827 | |
| 828 | 828 | auto tail_maybe = at_val<vm_list_t>(r.dest); |
| 829 | − if (tail_maybe != nullptr) | |
| 830 | − tail_maybe->release(); | |
| 831 | 829 | |
| 832 | 830 | // Create a new list |
| 833 | 831 | auto new_list = new vm_list_t{ type, tail_maybe }; |
| 832 | + if (tail_maybe != nullptr) | |
| 833 | + tail_maybe->release(); | |
| 834 | 834 | |
| 835 | 835 | auto destination = new_list->value(); |
| 836 | 836 | std::memmove(destination, r.src, type->size_in_bytes); |