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