Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect division by zero when inlining #648

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

jpellegrini
Copy link
Contributor

These two situations are similar, but one signals a compiler error, and the other signals an error after copilation:

stklos> (/)
**** Error:
compiler-error: /: needs at least one argument
	(type ",help" for more information)
stklos> (/ 2 0)
**** Error:
/: cannot make rational with null denominator
	(type ",help" for more information)

With this PR, both are treated similarly.

These two situations are similar, but one signals a compiler error,
and the other signals an error after copilation:

```scheme
stklos> (/)
**** Error:
compiler-error: /: needs at least one argument
	(type ",help" for more information)
stklos> (/ 2 0)
**** Error:
/: cannot make rational with null denominator
	(type ",help" for more information)
```

With this PR, both are treated similarly.
@egallesio egallesio merged commit 846b1eb into egallesio:master Aug 31, 2024
@egallesio
Copy link
Owner

Hi @jpellegrini,

I have applied this PR and changed a bit your code since we had some inconsistencies depending on the fact we had, or not, constant folding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants