aboutsummaryrefslogtreecommitdiff
path: root/opcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'opcode.c')
-rw-r--r--opcode.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/opcode.c b/opcode.c
index 768b2595..12eac8c1 100644
--- a/opcode.c
+++ b/opcode.c
@@ -3,7 +3,7 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_opcode="$Id: opcode.c,v 3.46 1995/10/17 14:30:05 roberto Exp roberto $"; 6char *rcs_opcode="$Id: opcode.c,v 3.47 1995/10/25 13:05:51 roberto Exp roberto $";
7 7
8#include <setjmp.h> 8#include <setjmp.h>
9#include <stdlib.h> 9#include <stdlib.h>
@@ -355,17 +355,13 @@ lua_Object lua_stackedfunction (int level)
355} 355}
356 356
357 357
358void lua_funcinfo (lua_Object func, char **filename, char **funcname, 358int lua_currentline (lua_Object func)
359 char **objname, int *line)
360{ 359{
361 Object *f = Address(func); 360 Object *f = Address(func);
362 luaI_funcInfo(f, filename, funcname, objname, line); 361 return (f+1 < top && (f+1)->tag == LUA_T_LINE) ? (f+1)->value.i : -1;
363 *line = (f+1 < top && (f+1)->tag == LUA_T_LINE) ?
364 (f+1)->value.i : -1;
365} 362}
366 363
367 364
368
369/* 365/*
370** Execute a protected call. Assumes that function is at CBase and 366** Execute a protected call. Assumes that function is at CBase and
371** parameters are on top of it. Leave nResults on the stack. 367** parameters are on top of it. Leave nResults on the stack.
@@ -406,7 +402,6 @@ static int do_protectedmain (void)
406 stack[CBase].tag = LUA_T_FUNCTION; 402 stack[CBase].tag = LUA_T_FUNCTION;
407 stack[CBase].value.tf = &tf; 403 stack[CBase].value.tf = &tf;
408 tf.lineDefined = 0; 404 tf.lineDefined = 0;
409 tf.name1 = tf.name2 = NULL;
410 tf.fileName = lua_parsedfile; 405 tf.fileName = lua_parsedfile;
411 tf.code = NULL; 406 tf.code = NULL;
412 if (setjmp(myErrorJmp) == 0) 407 if (setjmp(myErrorJmp) == 0)