elua: load regular file if bytecode cache fails
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 30 Aug 2017 18:19:24 +0000 (20:19 +0200)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 30 Aug 2017 18:21:23 +0000 (20:21 +0200)
commit67d1c0e51c01ba159f88adc6446cc31cee79c808
treedd4422fed624597ee2790bf1e6120a5fb464ed3b
parent8b5d555cf58f0d65a3d13ba94f61121a846eda8a
elua: load regular file if bytecode cache fails

If bytecode is requested and fails to load, load original file
instead. Force re-write of bytecode if that succeeds.

This is useful if there is bytecode newer than the source file that
the current Lua version can't load, for example when migrating from
LuaJIT 2.0 to 2.1, which changed bytecode format.

Fixes confusing cases such as in T2728.
src/lib/elua/cache.c