Skip to content

Instantly share code, notes, and snippets.

@dstogov
Created June 11, 2021 08:26
Show Gist options
  • Select an option

  • Save dstogov/523e5541135212a2811899ab7718218e to your computer and use it in GitHub Desktop.

Select an option

Save dstogov/523e5541135212a2811899ab7718218e to your computer and use it in GitHub Desktop.
diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c
index bee54586fc..d8f82e87b2 100644
--- a/Zend/Optimizer/zend_inference.c
+++ b/Zend/Optimizer/zend_inference.c
@@ -2393,13 +2393,13 @@ static zend_always_inline int _zend_update_type_info(
if (!(t1 & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_CLASS))
|| !(t2 & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_CLASS))) {
tmp = 0;
- if (ssa_op->result_def >= 0) {
+ if (ssa_op->result_def >= 0 && !(ssa_var_info[ssa_op->result_def].type & MAY_BE_REF)) {
UPDATE_SSA_TYPE(tmp, ssa_op->result_def);
}
- if (ssa_op->op1_def >= 0) {
+ if (ssa_op->op1_def >= 0 && !(ssa_var_info[ssa_op->op1_def].type & MAY_BE_REF)) {
UPDATE_SSA_TYPE(tmp, ssa_op->op1_def);
}
- if (ssa_op->op2_def >= 0) {
+ if (ssa_op->op2_def >= 0 && !(ssa_var_info[ssa_op->op2_def].type & MAY_BE_REF)) {
UPDATE_SSA_TYPE(tmp, ssa_op->op2_def);
}
return 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment