diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-01-23 21:02:10 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-01-23 21:02:10 -0200 |
commit | f88806a1fbf333b9495ffb9049c67ba27a3a6d49 (patch) | |
tree | c7af3e066f77c24b7450dd61d84938adcee60ee1 /ldump.c | |
parent | fb6eee2805c02356ffbeac8da8a2b9263af260fe (diff) | |
download | lua-github-f88806a1fbf333b9495ffb9049c67ba27a3a6d49.tar.gz |
"default: lua_assert(0)" in switches helps debugging + uses
non-variant types in binary files
Diffstat (limited to 'ldump.c')
-rw-r--r-- | ldump.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ /* -** $Id: ldump.c,v 1.19 2011/11/23 17:48:18 lhf Exp $ +** $Id: ldump.c,v 2.16 2011/11/24 13:25:41 roberto Exp roberto $ ** save precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -84,8 +84,8 @@ static void DumpConstants(const Proto* f, DumpState* D) for (i=0; i<n; i++) { const TValue* o=&f->k[i]; - DumpChar(ttype(o),D); - switch (ttype(o)) + DumpChar(ttypenv(o),D); + switch (ttypenv(o)) { case LUA_TNIL: break; @@ -98,6 +98,7 @@ static void DumpConstants(const Proto* f, DumpState* D) case LUA_TSTRING: DumpString(rawtsvalue(o),D); break; + default: lua_assert(0); } } n=f->sizep; |