diff options
author | Benoit Germain <bnt period germain arrobase gmail period com> | 2013-12-13 09:27:59 +0100 |
---|---|---|
committer | Benoit Germain <bnt period germain arrobase gmail period com> | 2013-12-13 09:27:59 +0100 |
commit | bfe766927eeced475904acdc08c0ec5375e5ab49 (patch) | |
tree | 718e3b5e8c2dbd8ab3f39ff11636e2baa8be4638 | |
parent | 8b681c0b810c617b1e4309b951622825e4f6bbe5 (diff) | |
download | lanes-bfe766927eeced475904acdc08c0ec5375e5ab49.tar.gz lanes-bfe766927eeced475904acdc08c0ec5375e5ab49.tar.bz2 lanes-bfe766927eeced475904acdc08c0ec5375e5ab49.zip |
Fix an incorrect assertion in lanes.require()
-rw-r--r-- | src/lanes.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lanes.c b/src/lanes.c index 467c920..6621735 100644 --- a/src/lanes.c +++ b/src/lanes.c | |||
@@ -1947,17 +1947,17 @@ static THREAD_RETURN_T THREAD_CALLCONV lane_main( void *vs) | |||
1947 | LUAG_FUNC( require) | 1947 | LUAG_FUNC( require) |
1948 | { | 1948 | { |
1949 | char const* name = lua_tostring( L, 1); | 1949 | char const* name = lua_tostring( L, 1); |
1950 | int const nargs = lua_gettop( L); | ||
1950 | STACK_CHECK( L); | 1951 | STACK_CHECK( L); |
1951 | DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "lanes.require %s BEGIN\n" INDENT_END, name)); | 1952 | DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "lanes.require %s BEGIN\n" INDENT_END, name)); |
1952 | DEBUGSPEW_CODE( ++ debugspew_indent_depth); | 1953 | DEBUGSPEW_CODE( ++ debugspew_indent_depth); |
1953 | lua_pushvalue( L, lua_upvalueindex(1)); // "name" require | 1954 | lua_pushvalue( L, lua_upvalueindex(1)); // "name" require |
1954 | lua_pushvalue( L, 1); // "name" require "name" | 1955 | lua_insert( L, 1); // require "name" |
1955 | lua_call( L, 1, 1); // "name" module | 1956 | lua_call( L, nargs, 1); // module |
1956 | populate_func_lookup_table( L, -1, name); | 1957 | populate_func_lookup_table( L, -1, name); |
1957 | lua_remove( L, -2); // module | ||
1958 | DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "lanes.require %s END\n" INDENT_END, name)); | 1958 | DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "lanes.require %s END\n" INDENT_END, name)); |
1959 | DEBUGSPEW_CODE( -- debugspew_indent_depth); | 1959 | DEBUGSPEW_CODE( -- debugspew_indent_depth); |
1960 | STACK_END( L, 1); | 1960 | STACK_END( L, 0); |
1961 | return 1; | 1961 | return 1; |
1962 | } | 1962 | } |
1963 | 1963 | ||