Skip to content

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Apr 15, 2025

In case a static field was provided with an initializer (that is, either a block of code or a constant that cannot be represented in the constant pool), the code of that initializer was never emitted. This commit fixes that.

In case a `static` field was provided with an initializer (that is,
either a block of code or a constant that cannot be represented in
the constant pool), the code of that initializer was never emitted.
This commit fixes that.
@Ladicek Ladicek added the 2.x Issue applies to Gizmo 2.x label Apr 15, 2025
@Ladicek
Copy link
Contributor Author

Ladicek commented Apr 15, 2025

Marking this as a draft because only the first added test passes. The second one doesn't, and I don't really see a way to fix that -- it seems it's a bug right in the dependency tracking thing I don't really understand :-) I'd appreciate if you @dmlloyd could take a look when you find the time.

@dmlloyd
Copy link
Member

dmlloyd commented Apr 15, 2025

It was a subtle block inlining problem. Blocks get inlined sometimes to help if optimize better, but it doesn't work correctly for non-void blocks.

@Ladicek Ladicek marked this pull request as ready for review April 15, 2025 14:49
@Ladicek Ladicek moved this to In Progress in WG - Gizmo 2 Apr 15, 2025
@Ladicek Ladicek merged commit 2872689 into quarkusio:main Apr 15, 2025
2 checks passed
@Ladicek Ladicek deleted the fix-static-field-with-initializer branch April 15, 2025 14:50
@github-project-automation github-project-automation bot moved this from In Progress to Done in WG - Gizmo 2 Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issue applies to Gizmo 2.x
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants