Merge pull request #26657 from marxin/fix-25641-ubsan-negative-value
Fix #25641 by not shifting a negative value.
This commit is contained in:
commit
85eb381a04
1 changed files with 2 additions and 1 deletions
|
@ -90,7 +90,8 @@ public:
|
||||||
}
|
}
|
||||||
CanvasKey(const RID &p_canvas, int p_layer, int p_sublayer) {
|
CanvasKey(const RID &p_canvas, int p_layer, int p_sublayer) {
|
||||||
canvas = p_canvas;
|
canvas = p_canvas;
|
||||||
stacking = ((int64_t)p_layer << 32) + p_sublayer;
|
int64_t sign = p_layer < 0 ? -1 : 1;
|
||||||
|
stacking = sign * (((int64_t)ABS(p_layer)) << 32) + p_sublayer;
|
||||||
}
|
}
|
||||||
int get_layer() const { return stacking >> 32; }
|
int get_layer() const { return stacking >> 32; }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue