From bc5933f905bff30c1e345b8f75f4d3547ddd21a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Thu, 8 Oct 2015 00:55:44 +0000 Subject: [PATCH] [INTERPRETER] * BUG: Fix a crash when trying twice accessing a collection without the good number of arguments. git-svn-id: svn://localhost/gambas/trunk@7395 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- main/gbx/gbx_exec_loop.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main/gbx/gbx_exec_loop.c b/main/gbx/gbx_exec_loop.c index 8462067da..4f5ef17f0 100644 --- a/main/gbx/gbx_exec_loop.c +++ b/main/gbx/gbx_exec_loop.c @@ -3536,7 +3536,14 @@ __PUSH_GENERIC: fast = 0x81 + np; } else if (class->quick_array == CQA_COLLECTION) + { + if (np < 1) + THROW(E_NEPARAM); + else if (np > 1) + THROW(E_TMPARAM); + fast = 0xC0; + } else { // Check the symbol existance, but *not virtually* @@ -3657,7 +3664,14 @@ __POP_GENERIC: if (class->quick_array == CQA_ARRAY) fast = 1; else if (class->quick_array == CQA_COLLECTION) + { + if (np < 2) + THROW(E_NEPARAM); + else if (np > 2) + THROW(E_TMPARAM); + fast = 2; + } else { // Check the symbol existance, but *not virtually*