lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Em ter., 10 de nov. de 2020 às 15:46, Luiz Henrique de Figueiredo <> escreveu:
> I think that it is possible to safely remove the initialization loop from the loadProtos function.
> Because the same array will be overwritten in the next loop, in the same positions.
> Is this correct?

No, it is not. The call to luaF_newproto in the next loop may raise
errors and f->p needs to be in a consistent state. The comments in the
loops in  loadUpvalues also apply to loadProtos.

I don't mean to be harsh and we do welcome suggestions and
corrections, but do you really think we write useless code?
Am I bothering you?