Mercerenies / latitude

Latitude - A prototype-oriented programming language
MIT License
7 stars 0 forks source link

Ref-count assertion failure when handling thunks in a unit test #36

Closed Mercerenies closed 6 years ago

Mercerenies commented 6 years ago

The following block of code results in an assertion failure (ptr->ref_count <= 0).

use 'unit-test.

test ::= Module clone.
unit-test TestModule inject (test).
callCC {
  escapable.
  test addTest 'name1 do { return "This is stupid and don't do this.". }.
}.
test runTests.

This block of code is clearly an infinite loop and could possibly overflow the call stack (though I doubt it), but it should certainly not be causing issues with the reference counter.

Mercerenies commented 6 years ago

The bug cannot be reproduced in 4460813, which means it was certainly introduced in 616fa7f, when the thunk warning was added.