From 5c207b7038d3a634e8a752ceb4ea3dcd1553ebfa Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Fri, 13 Dec 2024 16:10:52 -0500 Subject: Whatevs --- compiler.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'compiler.c') diff --git a/compiler.c b/compiler.c index d64d119..fd20694 100644 --- a/compiler.c +++ b/compiler.c @@ -30,11 +30,7 @@ Vector vect_init(size_t item_size) { } void _vect_grow(Vector *v) { - if (v->size / 2 > VECT_MAX_GROW) { - v->size += VECT_MAX_GROW; - } else { - v->size += v->size / 2; - } + v->size += VECT_MAX_GROW; v->data = realloc(v->data, v->size * v->_el_sz); } @@ -738,6 +734,7 @@ char *_op_get_register(int reg, int size) { default: printf("ERROR: invalid register size %d (this is a compiler issue)\n", size); vect_push(&out, &add); + vect_push_string(&out, "; Invalid register size"); break; } @@ -5322,6 +5319,7 @@ void eval_strict_arr(Module *mod, Vector *out, Vector *tokens, Variable *v, size int end = tnsl_find_closing(tokens, start); int count = 0; bool first = true; + start++; for (size_t i = start; i < end; i++) { cur = vect_get(tokens, i); @@ -5344,7 +5342,7 @@ void eval_strict_arr(Module *mod, Vector *out, Vector *tokens, Variable *v, size vect_push_string(&store, "\n"); first = true; - for (start++; start < end; start++) { + for (; start < end; start++) { cur = vect_get(tokens, start); if(tok_str_eq(cur, ",")) { first = true; @@ -5352,13 +5350,13 @@ void eval_strict_arr(Module *mod, Vector *out, Vector *tokens, Variable *v, size if (first) { first = false; if (_var_ptr_type(&strip) > 1) { - eval_strict_arr(mod, &store, tokens, &strip, start + 2, datalab, ntharr); - } else if (_var_ptr_type(v) > PTYPE_NONE) { - eval_strict_ptr(mod, &store, tokens, &strip, start + 2, datalab, ntharr); - } else if (!is_inbuilt(v->type->name)) { - eval_strict_composite(mod, &store, tokens, &strip, start + 2, datalab, ntharr); + eval_strict_arr(mod, &store, tokens, &strip, start, datalab, ntharr); + } else if (_var_ptr_type(&strip) > PTYPE_NONE) { + eval_strict_ptr(mod, &store, tokens, &strip, start, datalab, ntharr); + } else if (!is_inbuilt(strip.type->name)) { + eval_strict_composite(mod, &store, tokens, &strip, start, datalab, ntharr); } else { - eval_strict_literal(&store, tokens, &strip, start + 2); + eval_strict_literal(&store, tokens, &strip, start); } } -- cgit v1.2.3