microsoft / verona-rt

The runtime for the Verona project
MIT License
25 stars 14 forks source link

Fix repeated cown #34

Closed mjp41 closed 10 months ago

mjp41 commented 11 months ago

The runtime did not correctly handle repeated cowns in a single when, and would cause the behaviour to never fire, and any subsequent behaviour would be blocked.

That is the following code:

when(a,a) { abort(); }
when(a) { abort(); }

would never reach abort.

This PR fixes this by reducing the execution count if there are duplicates, and setting the cown associated with the Slot to null so that we do not we can skip the slot in release (it will never get a successor).