Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
Herman Venter edited this page Apr 11, 2018 · 2 revisions

Variable written to in optimized function conflicts with write in another optimized function

The variable written to by the function at this location is also written to in a separately optimized function. Prepack does not take the actions of other (non inlined) functions into account when it analyzes a function to optimize, therefore it may conclude that such a variable is in it's initial state, when it may in fact have been overwritten by an earlier (unknown to Prepack) call made to the separately optimized function.

The variable in question will typically be local to a module or to a function and accessed via an exported nested function. It may get written to because of lazy initialization. At this stage, it the only way to address such an issue is to make the initialization eager.

More work is needed on this kind of problem. Feel free to file an issue and explain your scenario to us.

Clone this wiki locally