Compiler crashes due to missing var_info in struct attribute when it validates modifications for immutable variables.
For immutable variables, the number of modifications is tracked. If the surpasses 1, an exception is raised:
https://github.com/vyperlang/vyper/blob/3b310d5292c4d1448e673d7b3adb223f9353260e/vyper/semantics/analysis/base.py#L249-L253
The tracking is done using the attribute var_info
. In certain scenarios this attribute is missing and the compiler crashes.
Suppose the following contract:
When compiling the compiler crashes with:
The compiler doesn't handle the modification checks (and possibly the var_info
assignments) correctly for all contracts, this could lead to undefined behavior. However, we didn't find such a scenario. As such, the impact is mainly a confusing error for the developer, which can slow down the development process.
Manual testing.
The semantic analyzer most likely doesn't properly annotate all the relevant nodes with var_info
(or annotates them too late). Ensure that the nodes have the necessary info needed to perform all the semantic passes.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.