diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-03-19 18:12:34 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-03-19 18:12:34 -0300 |
commit | 47527d2d3ca6e235d06adf567246c2f3bd424f65 (patch) | |
tree | 746b20823f16163a31e09951277176557dd7c952 /fallback.c | |
parent | 1444d28476af70bc51c4fdba71deb669f41c77a3 (diff) | |
download | lua-47527d2d3ca6e235d06adf567246c2f3bd424f65.tar.gz lua-47527d2d3ca6e235d06adf567246c2f3bd424f65.tar.bz2 lua-47527d2d3ca6e235d06adf567246c2f3bd424f65.zip |
setmethods should return old methods.
Diffstat (limited to 'fallback.c')
-rw-r--r-- | fallback.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_fallback="$Id: fallback.c,v 1.27 1997/03/11 18:44:28 roberto Exp roberto $"; | 6 | char *rcs_fallback="$Id: fallback.c,v 1.28 1997/03/19 19:41:10 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | #include <string.h> | 9 | #include <string.h> |
@@ -268,6 +268,7 @@ void luaI_setintmethod (void) | |||
268 | luaL_arg_check(lua_isnil(func) || lua_isfunction(func), "setintmethod", | 268 | luaL_arg_check(lua_isnil(func) || lua_isfunction(func), "setintmethod", |
269 | 3, "function expected"); | 269 | 3, "function expected"); |
270 | checktag(t); | 270 | checktag(t); |
271 | luaI_pushobject(&luaI_IMtable[-t].int_method[e]); | ||
271 | luaI_IMtable[-t].int_method[e] = *luaI_Address(func); | 272 | luaI_IMtable[-t].int_method[e] = *luaI_Address(func); |
272 | } | 273 | } |
273 | 274 | ||
@@ -286,6 +287,7 @@ void luaI_setglobalmethod (void) | |||
286 | lua_Object func = lua_getparam(2); | 287 | lua_Object func = lua_getparam(2); |
287 | luaL_arg_check(lua_isnil(func) || lua_isfunction(func), "setintmethod", | 288 | luaL_arg_check(lua_isnil(func) || lua_isfunction(func), "setintmethod", |
288 | 2, "function expected"); | 289 | 2, "function expected"); |
290 | luaI_pushobject(&gmethod[e]); | ||
289 | gmethod[e] = *luaI_Address(func); | 291 | gmethod[e] = *luaI_Address(func); |
290 | } | 292 | } |
291 | 293 | ||