Git Product home page Git Product logo

Comments (8)

fsantanna avatar fsantanna commented on July 28, 2024

There are no recoverable exceptions in Céu, i.e., the program should terminate with the message.
However, the segfault shouldn't happen in any case.

from ceu.

mterber avatar mterber commented on July 28, 2024

Ok, I just expected the program to escape 42 because of the following example:

var u8[2] foo;

foo = [] .. foo .. [4];
foo = [] .. foo .. [2];
foo = [] .. foo .. [7];

escape 42;

In this case obviously an access out of bounds error appears but the program nonetheless escapes 42:

[application.ceu:5] runtime error: access out of bounds
*** END: 42

So should it always terminate immediately after a runtime error message?

from ceu.

fsantanna avatar fsantanna commented on July 28, 2024

Yes, immediately.
Can you try to compile the final .c with -DCEU_DEBUG ?
I think this is the whole problem. The underlying assert is not being called, which explains the segfault and also why my tests aren't catching such a simple bug.

from ceu.

mterber avatar mterber commented on July 28, 2024

Sure. This leads to the following output:

(0): 1
(1): 2
(2): 3
(3): 4
[application.ceu:4] runtime error: access out of bounds
a.out: application.ceu:3558: ceu_sys_assert: Assertion `v' failed.
Aborted (core dumped)

from ceu.

fsantanna avatar fsantanna commented on July 28, 2024

Ok. Now the behavior is correct and the error also appears in the correct line.
I'll leave this issue open because of the -DCEU_DEBUG requirement.

from ceu.

mterber avatar mterber commented on July 28, 2024

Just as a complementary:

Now also the behaviour of the other example is correct...

var u8[2] foo;

foo = [] .. foo .. [4];
foo = [] .. foo .. [2];
foo = [] .. foo .. [7];

escape 42;

now leads to

[application.ceu:5] runtime error: access out of bounds
a.out: application.ceu:3557: ceu_sys_assert: Assertion `v' failed.
Aborted (core dumped)

means that it is terminated immediately after the error message without escaping 42 - as you specified!

from ceu.

fsantanna avatar fsantanna commented on July 28, 2024

Can you confirm if these applications crash with the correct message (even without -DCEU_DEBUG)?

from ceu.

mterber avatar mterber commented on July 28, 2024

Yes. Both examples crash with the correct assertion message even without -DCEU_DEBUG.

from ceu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.