summaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-06-01 17:24:05 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-06-01 17:24:05 -0300
commit4bb30f461b146e1d189ee301472953e948699acf (patch)
tree6672a04861449826d9c05af1ead524c4a7da5937 /lobject.h
parentdad85e41311646e37d995d677156d6b5daeff329 (diff)
downloadlua-github-4bb30f461b146e1d189ee301472953e948699acf.tar.gz
when assigning to a 'TValue', better assign only exact fields,
to allow us to put stuff after the 'TValuefields' if needed
Diffstat (limited to 'lobject.h')
-rw-r--r--lobject.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/lobject.h b/lobject.h
index f8a73a14..2bef659a 100644
--- 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