bug fix
This commit is contained in:
+7
-12
@@ -1,15 +1,10 @@
|
|||||||
|
|
||||||
fun k(k)
|
|
||||||
return k(k);
|
|
||||||
|
|
||||||
k(k);
|
|
||||||
|
|
||||||
fun x(a, b, c)
|
fun x(a, b, c)
|
||||||
print(a, b, c);
|
print('a = ', a, '\nb = ', b, '\nc = ', c, '\n\n');
|
||||||
|
|
||||||
print(x(1, 2, 3));
|
x(1, 2, 3, 4, 5);
|
||||||
|
x(1, 2, 3, 4);
|
||||||
fun hello()
|
x(1, 2, 3);
|
||||||
print('hel\nlo', 2);
|
x(1, 2); # Fails here!
|
||||||
|
x(1);
|
||||||
return hello();
|
x();
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
stack = {count: 0, head: none};
|
stack = {count: 0, head: none};
|
||||||
|
|
||||||
fun push(stack, value) {
|
fun push(stack, value)
|
||||||
|
{
|
||||||
node = {prev: null, item: value};
|
node = {prev: null, item: value};
|
||||||
|
|
||||||
node.prev = list.head;
|
node.prev = list.head;
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ Object *Object_NewMap(int num, Heap *heap, Error *error)
|
|||||||
|
|
||||||
obj->mapper_size = mapper_size;
|
obj->mapper_size = mapper_size;
|
||||||
obj->count = 0;
|
obj->count = 0;
|
||||||
obj->mapper = Heap_RawMalloc(heap, sizeof(int) * capacity, error);
|
obj->mapper = Heap_RawMalloc(heap, sizeof(int) * mapper_size, error);
|
||||||
obj->keys = Heap_RawMalloc(heap, sizeof(Object*) * capacity, error);
|
obj->keys = Heap_RawMalloc(heap, sizeof(Object*) * capacity, error);
|
||||||
obj->vals = Heap_RawMalloc(heap, sizeof(Object*) * capacity, error);
|
obj->vals = Heap_RawMalloc(heap, sizeof(Object*) * capacity, error);
|
||||||
|
|
||||||
|
|||||||
@@ -546,7 +546,7 @@ static _Bool step(Runtime *runtime, Error *error)
|
|||||||
{
|
{
|
||||||
// Variable not defined locally.
|
// Variable not defined locally.
|
||||||
|
|
||||||
if(runtime->builtins)
|
if(runtime->builtins != NULL)
|
||||||
obj = Object_Select(runtime->builtins, key, runtime->heap, error);
|
obj = Object_Select(runtime->builtins, key, runtime->heap, error);
|
||||||
|
|
||||||
if(obj == NULL)
|
if(obj == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user