Browse Source

Sol Part 45.1: What Has Science Done?!

Graham Northup 5 years ago
parent
commit
e0f8219e59
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      builtins.c

+ 3
- 0
builtins.c View File

@@ -57,9 +57,12 @@ sol_object_t *sol_f_default_repr(sol_state_t *state, sol_object_t *args) {
57 57
 
58 58
 sol_object_t *sol_f_tbang(sol_state_t *state, sol_object_t *args) {
59 59
 	sol_object_t *a = sol_list_get_index(state, args, 0), *b = sol_list_get_index(state, args, 1);
60
+	int refa = a->refcnt, refb = b->refcnt;
60 61
 	sol_object_t c = *b;
61 62
 	*b = *a;
62 63
 	*a = c;
64
+	b->refcnt = refa;
65
+	a->refcnt = refb;
63 66
 	sol_obj_free(a);
64 67
 	sol_obj_free(b);
65 68
 	return sol_incref(state->None);

Loading…
Cancel
Save