compile.c: eliminate getinstancevariable -> pop sequences

This case wasn't eliminated before because `getinstancevariable`
could emit a warning, but that's no longer the case since Ruby
3.0.
This commit is contained in:
Jean Boussier 2023-02-20 17:38:00 +01:00 committed by Jean Boussier
parent ecd0cdaf82
commit 0459eaec95
Notes: git 2023-02-20 18:04:29 +00:00

View File

@ -3319,7 +3319,7 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
previ == BIN(getlocal) ||
previ == BIN(getblockparam) ||
previ == BIN(getblockparamproxy) ||
/* getinstancevariable may issue a warning */
previ == BIN(getinstancevariable) ||
previ == BIN(duparray)) {
/* just push operand or static value and pop soon, no
* side effects */