Integrated: 8278141: LIR_OpLoadKlass::_info shadows the field of the same name from LIR_Op

Aleksey Shipilev shade at openjdk.java.net
Fri Dec 3 15:46:20 UTC 2021


On Thu, 2 Dec 2021 12:31:41 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> SonarCloud complains about code added in [JDK-8277417](https://bugs.openjdk.java.net/browse/JDK-8277417):
>  Field "_info" shadows a field of the same name in base class "LIR_Op"
> 
> 
> class LIR_OpLoadKlass: public LIR_Op {
>   friend class LIR_OpVisitState;
> 
>  private:
>   LIR_Opr _obj;
>   CodeEmitInfo* _info; <--- here
> 
> 
> From the look of it, it seems risky to have two inconsistent fields here. Depending on which base class we use to access it, we might have different `_info`-s referenced. @rkennke, that was not intentional, was it? I don't see the mentions of this oddity in the original PR.
> 
> The fix is to push `CodeEmitInfo` to super-class `LIR_Op`, and use it from there.
> 
> Additional testing:
>  - [x] Linux x86_64 fastdebug `tier1`
>  - [x] Linux x86_64 fastdebug `tier2`

This pull request has now been integrated.

Changeset: 0e7b6bcd
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/0e7b6bcd8260293c3d39417f04b9b1e4409aa20a
Stats:     4 lines in 1 file changed: 0 ins; 2 del; 2 mod

8278141: LIR_OpLoadKlass::_info shadows the field of the same name from LIR_Op

Reviewed-by: thartmann, rkennke

-------------

PR: https://git.openjdk.java.net/jdk/pull/6669


More information about the hotspot-compiler-dev mailing list