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

ConstantExpressionEvaluation don't handle div by zero #3

Open
HaraldGustafsson opened this issue Aug 16, 2013 · 0 comments
Open

ConstantExpressionEvaluation don't handle div by zero #3

HaraldGustafsson opened this issue Aug 16, 2013 · 0 comments
Assignees
Labels

Comments

@HaraldGustafsson
Copy link
Contributor

When evaluating constant expressions when instantiating if the divider becomes 0 the compilation crashes, even when protected by an if-statement.

Compilation failed, no output written.
/ by zero :: java.lang.ArithmeticException: / by zero
java.lang.ArithmeticException: / by zero
at org.caltoopia.ast2ir.ConstantExpressionEvaluator.caseBinaryExpression(ConstantExpressionEvaluator.java:358)
at org.caltoopia.ir.util.IrReplaceSwitch.caseBinaryExpression(IrReplaceSwitch.java:1)
at org.caltoopia.ir.util.IrSwitch.doSwitch(IrSwitch.java:274)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
at org.caltoopia.ir.util.IrReplaceSwitch.caseProcCall(IrReplaceSwitch.java:572)
at org.caltoopia.ir.util.IrReplaceSwitch.caseProcCall(IrReplaceSwitch.java:1)
at org.caltoopia.ir.util.IrSwitch.doSwitch(IrSwitch.java:377)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
at org.caltoopia.ast2ir.ConstantExpressionEvaluator.caseBlock(ConstantExpressionEvaluator.java:222)
at org.caltoopia.ast2ir.ConstantExpressionEvaluator.caseBlock(ConstantExpressionEvaluator.java:1)
at org.caltoopia.ir.util.IrReplaceSwitch.caseBlock(IrReplaceSwitch.java:1)
at org.caltoopia.ir.util.IrSwitch.doSwitch(IrSwitch.java:409)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
at org.caltoopia.ir.util.IrReplaceSwitch.caseIfStatement(IrReplaceSwitch.java:623)
at org.caltoopia.ir.util.IrReplaceSwitch.caseIfStatement(IrReplaceSwitch.java:1)
at org.caltoopia.ir.util.IrSwitch.doSwitch(IrSwitch.java:401)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
at org.caltoopia.ir.util.IrReplaceSwitch.caseAction(IrReplaceSwitch.java:241)
at org.caltoopia.ast2ir.ConstantExpressionEvaluator.caseAction(ConstantExpressionEvaluator.java:209)
at org.caltoopia.ir.util.IrReplaceSwitch.caseActor(IrReplaceSwitch.java:195)
at org.caltoopia.ir.util.IrReplaceSwitch.caseActor(IrReplaceSwitch.java:1)
at org.caltoopia.ir.util.IrSwitch.doSwitch(IrSwitch.java:137)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53)
at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
at org.caltoopia.ast2ir.ConstantExpressionEvaluator.evaluate(ConstantExpressionEvaluator.java:180)
at org.caltoopia.ast2ir.Instantiator.instantiate(Instantiator.java:88)
at org.caltoopia.cli.Cal2C.generate(Cal2C.java:352)
at org.caltoopia.frontend.ui.launch.CaltoopiaLaunchConfigurationDelegate.launch(CaltoopiaLaunchConfigurationDelegate.java:158)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

@ghost ghost assigned ekeroid Aug 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants