lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 4bb30f461b146e1d189ee301472953e948699acf
parent dad85e41311646e37d995d677156d6b5daeff329
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Thu,  1 Jun 2017 17:23:38 -0300

when assigning to a 'TValue', better assign only exact fields,
to allow us to put stuff after the 'TValuefields' if needed

Diffstat:
Mlobject.h | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lobject.h b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.119 2017/04/24 18:06:12 roberto Exp roberto $ +** $Id: lobject.h,v 2.120 2017/04/30 20:43:26 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -108,7 +108,7 @@ typedef union Value { } Value; -#define TValuefields Value value_; int tt_ +#define TValuefields Value value_; lu_byte tt_ typedef struct lua_TValue { @@ -258,7 +258,8 @@ typedef struct lua_TValue { #define setobj(L,obj1,obj2) \ - { TValue *io1=(obj1); *io1 = *(obj2); \ + { TValue *io1=(obj1); const TValue *io2=(obj2); \ + io1->value_ = io2->value_; io1->tt_ = io2->tt_; \ (void)L; checkliveness(L,io1); } @@ -278,9 +279,8 @@ typedef struct lua_TValue { /* to new object */ #define setobj2n setobj #define setsvalue2n setsvalue - -/* to table (define it as an expression to be used in macros) */ -#define setobj2t(L,o1,o2) ((void)L, *(o1)=*(o2), checkliveness(L,(o1))) +/* to table */ +#define setobj2t setobj