Switch values to having their data refcounted separately.

This allows for values to be "cast" and have a different type, while
still referencing the same data.
This commit is contained in:
2018-05-14 17:41:41 -07:00
parent 3e8c814215
commit cf3136a237
5 changed files with 72 additions and 20 deletions

View File

@@ -25,7 +25,7 @@ libab_result _interpreter_create_num_val(struct interpreter_state* state,
libab_result result = LIBAB_SUCCESS;
if((data = state->ab->impl.parse_num(from))) {
result = libab_create_value(into, data, &state->ab->type_num);
result = libab_create_value_raw(into, data, &state->ab->type_num);
if(result != LIBAB_SUCCESS) {
((libab_parsetype*) libab_ref_get(&state->ab->type_num))->data_u.base->free_function(data);