digego / extempore

A cyber-physical programming environment
1.41k stars 127 forks source link

Weird segfault with arrays and arithmetic #268

Closed tschicke closed 5 years ago

tschicke commented 8 years ago

Trying to define this function causes extempore to crash with a segfault

(bind-func test-func
  (let ((test:|1,i32|* (alloc)))
    (lambda ()
      (* 3.0 (/ (aref test 0) 4.0))
      5.0)))

This one gives the correct error message that it couldn't resolve to type

(bind-func test-func
  (let ((test:|1,i32|* (alloc)))
    (lambda ()
      (* 3.0 (/ (aref test 0) 4.0)))))

as does this one

(bind-func test-func
  (let ((test:|1,i32|* (alloc)))
    (lambda ()
      (* (/ (aref test 0) 4.0) 3.0)
      5.0)))

Only the first one, where presumably it is trying to get (/ (aref test 0) 4.0) to be a double, crashes.

digego commented 7 years ago

Seems OK to me (i.e. no crash). Good chance something has changed (for the better) in the last 12 months. I'll close this if there are no objections :)