@@ -582,7 +582,7 @@ int comp_check_labels() {
582582}
583583
584584/*
585- * returns true if 'name' is a unit or c-module
585+ * returns 1 if 'name' is a unit, 2 if 'name' c-module otherwise 0
586586 */
587587int comp_check_lib (const char * name ) {
588588 char tmp [SB_KEYWORD_SIZE + 1 ];
@@ -599,7 +599,7 @@ int comp_check_lib(const char *name) {
599599 char * lib_name = dir_sep ? dir_sep + 1 : lib -> alias ;
600600
601601 if (strcasecmp (lib_name , tmp ) == 0 ) {
602- return 1 ;
602+ return lib -> type == 0 ? 2 : 1 ;
603603 }
604604 }
605605 }
@@ -678,15 +678,22 @@ bid_t comp_var_getID(const char *var_name) {
678678 //
679679 // If the name is not found in comp_libtable then it
680680 // is treated as a structure reference
681- if (dot != NULL && comp_check_lib (tmp )) {
682- for (i = 0 ; i < comp_varcount ; i ++ ) {
683- if (strcasecmp (comp_vartable [i ].name , tmp ) == 0 ) {
684- return i ;
681+ if (dot != NULL ) {
682+ int module_type = comp_check_lib (tmp );
683+ if (module_type ) {
684+ for (i = 0 ; i < comp_varcount ; i ++ ) {
685+ if (strcasecmp (comp_vartable [i ].name , tmp ) == 0 ) {
686+ return i ;
687+ }
688+ }
689+ if (module_type == 2 ) {
690+ * dot = '\0' ;
691+ sc_raise (MSG_MODULE_NO_MEMBER , tmp , dot + 1 );
692+ } else {
693+ sc_raise (MSG_MEMBER_DOES_NOT_EXIST , tmp );
685694 }
695+ return 0 ;
686696 }
687-
688- sc_raise (MSG_MEMBER_DOES_NOT_EXIST , tmp );
689- return 0 ;
690697 }
691698 //
692699 // search in global name-space
@@ -4707,7 +4714,11 @@ int comp_pass1(const char *section, const char *text) {
47074714 comp_line = comp_udptable [i ].pline ;
47084715 char * dot = strchr (comp_udptable [i ].name , '.' );
47094716 if (dot ) {
4710- sc_raise (MSG_UNDEFINED_MAP , comp_udptable [i ].name );
4717+ if (comp_check_lib (comp_udptable [i ].name ) == 2 ) {
4718+ sc_raise (MSG_MODULE_NO_RETURN , comp_udptable [i ].name );
4719+ } else {
4720+ sc_raise (MSG_UNDEFINED_MAP , comp_udptable [i ].name );
4721+ }
47114722 } else {
47124723 if (comp_is_func (comp_udptable [i ].name ) != -1 ) {
47134724 sc_raise (MSG_FUNC_NOT_ASSIGNED , comp_udptable [i ].name );
0 commit comments