Function dump stripping doesn't affect start/end line numbers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Function dump stripping doesn't affect start/end line numbers

Sergey Zakharchenko
Hello,

I've noticed that the function's linedefined/lastlinedefined fields
are always dumped in DumpFunction, regardless of D->strip. Is there a
reason for not e.g. replacing them with 0 or -1 if stripping is
enabled?

Best regards,

--
DoubleF

Reply | Threaded
Open this post in threaded view
|

Re: Function dump stripping doesn't affect start/end line numbers

Luiz Henrique de Figueiredo
> I've noticed that the function's linedefined/lastlinedefined fields
> are always dumped in DumpFunction, regardless of D->strip. Is there a
> reason for not e.g. replacing them with 0 or -1 if stripping is
> enabled?

I think it's supposed to provide minimal indication of where an error
occurred, even for stripped bytecode. See
        http://lua-users.org/lists/lua-l/2014-02/msg00228.html

The fields are already there, replacing them with 0 or -1 would not save
any space, which is the main motivation for stripping.