nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
compiler: runtime error (instead of noop) on dead/invalid code
[nit.git]
/
src
/
compiler
/
abstract_compiler.nit
diff --git
a/src/compiler/abstract_compiler.nit
b/src/compiler/abstract_compiler.nit
index
8d3f7db
..
b69a049
100644
(file)
--- a/
src/compiler/abstract_compiler.nit
+++ b/
src/compiler/abstract_compiler.nit
@@
-1637,8
+1637,9
@@
abstract class AbstractCompilerVisitor
if nexpr == null then return
if nexpr.mtype == null and not nexpr.is_typed then
# Untyped expression.
if nexpr == null then return
if nexpr.mtype == null and not nexpr.is_typed then
# Untyped expression.
- # Might mean dead code
- # So just return
+ # Might mean dead code or invalid code
+ # so aborts
+ add_abort("FATAL: bad statement executed.")
return
end
return
end
@@
-1662,8
+1663,10
@@
abstract class AbstractCompilerVisitor
do
if nexpr.mtype == null then
# Untyped expression.
do
if nexpr.mtype == null then
# Untyped expression.
- # Might mean dead code
- # so return a placebo result
+ # Might mean dead code or invalid code.
+ # so aborts
+ add_abort("FATAL: bad expression executed.")
+ # and return a placebo result to please the C compiler
if mtype == null then mtype = compiler.mainmodule.object_type
return new_var(mtype)
end
if mtype == null then mtype = compiler.mainmodule.object_type
return new_var(mtype)
end