-
Bug
-
Resolution: Fixed
-
P4
-
21
-
b06
```
int _hash_computed:1;
int _exact_klass_computed:1;
int _is_loaded_computed:1;
```
SonarCloud reports a warning for them:
Single-bit named bit fields should not be of a signed type cpp:S2216
With 1 bit field, there is only a place for sign, not the value. Storing "1" into that field might effectively converts it to "-1" on the compilers I have tried. These fields are currently used as "booleans" by boolean-converting non-zeros to true, so there is no bug yet for those compilers. But, I can see how a compiler can convert "1" to "0", only effectively storing the sign bit, introducing subtle bugs.
- relates to
-
JDK-8297933 [REDO] Compiler should only use verified interface types for optimization
-
- Resolved
-
- links to
-
Commit openjdk/jdk/abfd7e89
-
Review(master) openjdk/jdk/11989