From 7f00049b8b579eb1ff9f9a01744091a3298eef9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Thu, 18 Mar 2010 15:40:34 +0000 Subject: [PATCH] [INTERPRETER] * BUG: Inherited startup Main methods work again. git-svn-id: svn://localhost/gambas/trunk@2807 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbx/gbx_exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/gbx/gbx_exec.c b/main/gbx/gbx_exec.c index 403c8c0b6..beab7ae31 100644 --- a/main/gbx/gbx_exec.c +++ b/main/gbx/gbx_exec.c @@ -1385,12 +1385,12 @@ __RETURN: void EXEC_public_desc(CLASS *class, void *object, CLASS_DESC_METHOD *desc, int nparam) { EXEC.object = object; - EXEC.class = desc->class; // Because the method can be an inherited one! EXEC.nparam = nparam; /*desc->npmin;*/ EXEC.drop = FALSE; if (FUNCTION_is_native(desc)) { + EXEC.class = class; // EXEC_native() does not need the real class, except the GB.GetClass(NULL) API used by Form.Main. EXEC.native = TRUE; EXEC.use_stack = FALSE; EXEC.desc = desc; @@ -1401,6 +1401,7 @@ void EXEC_public_desc(CLASS *class, void *object, CLASS_DESC_METHOD *desc, int n } else { + EXEC.class = desc->class; // EXEC_function_real() needs the effective class, because the method can be an inherited one! EXEC.native = FALSE; EXEC.index = (int)(intptr_t)desc->exec; EXEC_function_keep();