diff options
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 14 |
1 files changed, 9 insertions, 5 deletions
| @@ -753,7 +753,7 @@ void luaK_setoneret (FuncState *fs, expdesc *e) { | |||
| 753 | 753 | ||
| 754 | 754 | ||
| 755 | /* | 755 | /* |
| 756 | ** Ensure that expression 'e' is not a variable (nor a constant). | 756 | ** Ensure that expression 'e' is not a variable (nor a <const>). |
| 757 | ** (Expression still may have jump lists.) | 757 | ** (Expression still may have jump lists.) |
| 758 | */ | 758 | */ |
| 759 | void luaK_dischargevars (FuncState *fs, expdesc *e) { | 759 | void luaK_dischargevars (FuncState *fs, expdesc *e) { |
| @@ -805,8 +805,8 @@ void luaK_dischargevars (FuncState *fs, expdesc *e) { | |||
| 805 | 805 | ||
| 806 | 806 | ||
| 807 | /* | 807 | /* |
| 808 | ** Ensures expression value is in register 'reg' (and therefore | 808 | ** Ensure expression value is in register 'reg', making 'e' a |
| 809 | ** 'e' will become a non-relocatable expression). | 809 | ** non-relocatable expression. |
| 810 | ** (Expression still may have jump lists.) | 810 | ** (Expression still may have jump lists.) |
| 811 | */ | 811 | */ |
| 812 | static void discharge2reg (FuncState *fs, expdesc *e, int reg) { | 812 | static void discharge2reg (FuncState *fs, expdesc *e, int reg) { |
| @@ -860,7 +860,8 @@ static void discharge2reg (FuncState *fs, expdesc *e, int reg) { | |||
| 860 | 860 | ||
| 861 | 861 | ||
| 862 | /* | 862 | /* |
| 863 | ** Ensures expression value is in any register. | 863 | ** Ensure expression value is in a register, making 'e' a |
| 864 | ** non-relocatable expression. | ||
| 864 | ** (Expression still may have jump lists.) | 865 | ** (Expression still may have jump lists.) |
| 865 | */ | 866 | */ |
| 866 | static void discharge2anyreg (FuncState *fs, expdesc *e) { | 867 | static void discharge2anyreg (FuncState *fs, expdesc *e) { |
| @@ -946,8 +947,11 @@ int luaK_exp2anyreg (FuncState *fs, expdesc *e) { | |||
| 946 | exp2reg(fs, e, e->u.info); /* put final result in it */ | 947 | exp2reg(fs, e, e->u.info); /* put final result in it */ |
| 947 | return e->u.info; | 948 | return e->u.info; |
| 948 | } | 949 | } |
| 950 | /* else expression has jumps and cannot change its register | ||
| 951 | to hold the jump values, because it is a local variable. | ||
| 952 | Go through to the default case. */ | ||
| 949 | } | 953 | } |
| 950 | luaK_exp2nextreg(fs, e); /* otherwise, use next available register */ | 954 | luaK_exp2nextreg(fs, e); /* default: use next available register */ |
| 951 | return e->u.info; | 955 | return e->u.info; |
| 952 | } | 956 | } |
| 953 | 957 | ||
