diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-26 14:07:20 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-26 14:07:20 -0300 |
| commit | f935d3397ea56699d5ad218fade597514155e580 (patch) | |
| tree | 6284616422cfea6ecbf51b40397756fee11d11f9 | |
| parent | 30dd3a2dbc9f503dfdb119e00635aff64715bd46 (diff) | |
| download | lua-f935d3397ea56699d5ad218fade597514155e580.tar.gz lua-f935d3397ea56699d5ad218fade597514155e580.tar.bz2 lua-f935d3397ea56699d5ad218fade597514155e580.zip | |
check if jump is bigger than 2^16.
| -rw-r--r-- | lua.stx | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -1,6 +1,6 @@ | |||
| 1 | %{ | 1 | %{ |
| 2 | 2 | ||
| 3 | char *rcs_luastx = "$Id: lua.stx,v 3.31 1996/02/13 17:30:39 roberto Exp roberto $"; | 3 | char *rcs_luastx = "$Id: lua.stx,v 3.32 1996/02/14 18:25:04 roberto Exp roberto $"; |
| 4 | 4 | ||
| 5 | #include <stdio.h> | 5 | #include <stdio.h> |
| 6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
| @@ -109,10 +109,12 @@ static void code_code (TFunc *tf) | |||
| 109 | code_byte(code.m.c4); | 109 | code_byte(code.m.c4); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | static void code_word_at (Byte *p, Word n) | 112 | static void code_word_at (Byte *p, int n) |
| 113 | { | 113 | { |
| 114 | CodeWord code; | 114 | CodeWord code; |
| 115 | code.w = n; | 115 | if ((Word)n != n) |
| 116 | yyerror("block too big"); | ||
| 117 | code.w = (Word)n; | ||
| 116 | *p++ = code.m.c1; | 118 | *p++ = code.m.c1; |
| 117 | *p++ = code.m.c2; | 119 | *p++ = code.m.c2; |
| 118 | } | 120 | } |
