[INTERPRETER]

* BUG: Correctly load optional exported classes at component loading.


git-svn-id: svn://localhost/gambas/trunk@7539 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2015-12-30 17:10:00 +00:00
parent c255863403
commit 97ab7c0a3a

View file

@ -45,6 +45,8 @@
#include "gb_arch_temp.h" #include "gb_arch_temp.h"
//#define DEBUG_COMP 1
/* main archive project (used only if gbx is run with -x flag) */ /* main archive project (used only if gbx is run with -x flag) */
ARCHIVE *ARCHIVE_main = NULL; ARCHIVE *ARCHIVE_main = NULL;
@ -158,17 +160,11 @@ void ARCHIVE_load_exported_class(ARCHIVE *arch, int pass)
else else
class = CLASS_find_global(name);*/ class = CLASS_find_global(name);*/
if (!optional || CLASS_look_global(name, len) == NULL)
{
class = CLASS_find_global(name); class = CLASS_find_global(name);
CLASS_check_global(class); CLASS_check_global(class);
if (optional)
{
if (CLASS_look_global(name, len))
class = NULL;
}
if (class)
{
#if DEBUG_COMP #if DEBUG_COMP
fprintf(stderr, "Add to load: %p %s\n", class, name); fprintf(stderr, "Add to load: %p %s\n", class, name);
#endif #endif
@ -182,7 +178,7 @@ void ARCHIVE_load_exported_class(ARCHIVE *arch, int pass)
FREE(&buffer); FREE(&buffer);
} }
if (pass & AR_FIND_ONLY) if (pass & AR_FIND_ONLY) // That way the 'pass' flag is always ignored.
{ {
#if DEBUG_COMP #if DEBUG_COMP
fprintf(stderr, "<Load pass>\n"); fprintf(stderr, "<Load pass>\n");