aardappel / lobster

The Lobster Programming Language

Home Page:http://strlen.com/lobster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash while adding objects to an array

highco opened this issue · comments

The following code crashes when compiled with "--cpp"

class Lesson:
    day:int

def simulate():
    let lessons = []::Lesson
    for(10000) day:
        let lesson = Lesson{ day }
        lessons.push(lesson)

simulate()

with this error:
image

Thanks for reporting! Just fixed here: fab59cd

This was a stack overflow, because the backwards jump in the for was implemented as a call. This all caused by an accidental duplication of a variable..