blech-lang / blech

Blech is a language for developing reactive, real-time critical embedded software.
Apache License 2.0
64 stars 5 forks source link

Abort statement not working #15

Open MohamedGhardallou opened 11 months ago

MohamedGhardallou commented 11 months ago

Hello , with the last compiler version i have this behavior :

activity inc()(x: int32)

  repeat
    x = x + 1
    await true
  end

end

@[EntryPoint]
activity Ctrl()(x: int32 , y: int32)
  y = 0
  x = 0
  await true

  when x > 5 abort
      cobegin 
        run inc()(x)
      with
        run inc()(y)
      end
  end
end

the output sequence of this program is : x 0 y 0 x 1 y 1 x 2 y 2 x 3 y 3 x 4 y 4 x 5 y 5 x 6 y 6 x 6 y 6 x 6 y 6 x 6 y 6 ...

if you replace the condition x > 5 by y > 5 the program should have that same output sequence but we have this output instead:

x 0 y 0 x 1 y 1 x 1 y 1 x 1 y 1 x 1 y 1 x 1 y 1 x 1 y 1 x 1 y 1 x 1 y 1 x 1 y 1 ...

MohamedGhardallou commented 11 months ago

the bug is apparently related to the use of external environment variables