Skip to content

Commit

Permalink
FIX: force compilation to fail if an assignment is used as a function…
Browse files Browse the repository at this point in the history
… return value.

FIX: runtime errors caused by incorrect code generation for floats in parens as return value.
  • Loading branch information
dockimbel committed Mar 1, 2012
1 parent dd5953a commit e506636
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion red-system/compiler.r
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,13 @@ system-dialect: context [
type: resolve-aliased type
if alias: select aliased-types expected/1 [expected: alias]
]
if all [
ret
block? expr
any [set-word? expr/1 set-path? expr/1]
][
type: none
]
unless any [
all [
object? expr
Expand Down Expand Up @@ -1971,7 +1978,7 @@ system-dialect: context [
]
paren? pc/1 [
unless infix? at pc 2 [raise-paren-error]
expr: fetch-expression/final
expr: fetch-expression/final/keep
]
all [word? pc/1 pc/1 = 'comment][pc: skip pc 2]
'else [expr: fetch-expression/final/keep]
Expand Down

0 comments on commit e506636

Please sign in to comment.