patch 9.0.2038: Vim9: object method funcref not cleaned up after use

Problem:  Vim9: object method funcref not cleaned up after use
Solution: Clean up type stack after using object method funcref,
          remove now longer used ISN_DEFEROBJ instrunction

closes: #13360

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
diff --git a/src/vim9expr.c b/src/vim9expr.c
index c91ca93..85eb7af 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -450,9 +450,9 @@
 		return FAIL;
 	    }
 	    *arg = name_end;
-	    if (type->tt_type == VAR_OBJECT)
-		return generate_FUNCREF(cctx, fp, cl, TRUE, m_idx, NULL);
-	    return generate_FUNCREF(cctx, fp, NULL, FALSE, 0, NULL);
+	    // Remove the object type from the stack
+	    --cctx->ctx_type_stack.ga_len;
+	    return generate_FUNCREF(cctx, fp, cl, TRUE, m_idx, NULL);
 	}
 
 	member_not_found_msg(cl, VAR_OBJECT, name, len);
@@ -490,9 +490,9 @@
 		return FAIL;
 	    }
 	    *arg = name_end;
-	    if (type->tt_type == VAR_CLASS)
-		return generate_FUNCREF(cctx, fp, cl, FALSE, m_idx, NULL);
-	    return generate_FUNCREF(cctx, fp, NULL, FALSE, 0, NULL);
+	    // Remove the class type from the stack
+	    --cctx->ctx_type_stack.ga_len;
+	    return generate_FUNCREF(cctx, fp, cl, FALSE, m_idx, NULL);
 	}
 
 	member_not_found_msg(cl, VAR_CLASS, name, len);