Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
ce662eca
Commit
ce662eca
authored
Jun 06, 2016
by
John van Groningen
Browse files
fix bug that occurs if the same label name is used for inline code in different system modules
parent
5455f843
Changes
6
Hide whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/backend.c
View file @
ce662eca
...
...
@@ -470,6 +470,7 @@ BEDeclareDclModule (int moduleIndex, CleanString name, CleanString modificationT
dclModule
->
dm_modification_time
=
ConvertCleanString
(
modificationTime
);
dclModule
->
dm_system_module
=
isSystemModule
;
dclModule
->
dm_symbols
=
gBEState
.
be_allSymbols
;
/* ??? too many symbols? */
dclModule
->
dm_system_module_table_kind
=
FirstSystemModuleTable
+
moduleIndex
;
AddOpenDefinitionModule
(
moduleNameSymbol
,
dclModule
);
...
...
backendC/CleanCompilerSources/checker_2.c
View file @
ce662eca
...
...
@@ -91,7 +91,7 @@ void ReadInlineCode (void)
if
(
symbol
!=
NULL
&&
d_mod
->
mod_name
->
symb_ident
->
ident_name
!=
CurrentModule
)
/* Get the inline instructions of all the rules that are defined in this module */
ScanInlineFile
(
d_mod
->
mod_name
->
symb_ident
->
ident_name
);
ScanInlineFile
(
d_mod
->
mod_name
->
symb_ident
->
ident_name
,
def_mod
->
dm_system_module_table_kind
);
}
}
}
...
...
backendC/CleanCompilerSources/codegen2.h
View file @
ce662eca
...
...
@@ -38,8 +38,6 @@ extern int selector_m_error_lab_used;
extern
LabDef
selector_m_error_lab
;
extern
LabDef
*
unboxed_cons_label
(
SymbolP
cons_symbol_p
);
extern
void
ScanInlineFile
(
char
*
fname
);
extern
Bool
EqualState
(
StateS
st1
,
StateS
st2
);
extern
void
DetermineSizeOfArguments
(
ArgS
*
args
,
int
*
a_offset_p
,
int
*
b_offset_p
);
extern
void
SubSizeOfState
(
StateS
state
,
int
*
a_offset_p
,
int
*
b_offset_p
);
...
...
backendC/CleanCompilerSources/scanner.h
View file @
ce662eca
...
...
@@ -68,4 +68,4 @@ extern void ScanInitialise (void);
extern
void
ScanInitIdentStringTable
(
void
);
extern
void
ScanInlineFile
(
char
*
fname
);
extern
void
ScanInlineFile
(
char
*
fname
,
TableKind
table_kind
);
backendC/CleanCompilerSources/scanner_2.c
View file @
ce662eca
...
...
@@ -185,7 +185,7 @@ PutKeyWordInTable (KeyWordInfoP keyWord)
identString
->
ident
=
ident
;
}
/* PutKeyWordInTable */
static
IdentP
RetrieveFromSymbolTable
(
char
*
string
)
static
IdentP
RetrieveFromSymbolTable
(
char
*
string
,
TableKind
table_kind
)
{
char
*
s
;
unsigned
long
hash
;
...
...
@@ -222,7 +222,7 @@ static IdentP RetrieveFromSymbolTable (char *string)
if
(
identString
!=
NIL
){
for
(
ident
=
identString
->
ident
;
ident
!=
NIL
;
ident
=
ident
->
ident_next
)
if
(
ident
->
ident_table
==
SymbolIdTable
)
if
(
ident
->
ident_table
==
table_kind
)
break
;
}
else
ident
=
NIL
;
...
...
@@ -425,7 +425,7 @@ void clear_inline_cache (void)
}
#endif
void
ScanInlineFile
(
char
*
fname
)
void
ScanInlineFile
(
char
*
fname
,
TableKind
system_module_table_kind
)
{
register
char
*
tail
,
*
instr
,
*
importingModule
,
*
importingExtension
;
IdentP
instrid
;
...
...
@@ -485,7 +485,7 @@ void ScanInlineFile (char *fname)
continue
;
*
tail
=
'\0'
;
if
(
!
(
instrid
=
RetrieveFromSymbolTable
(
instr
)))
if
(
!
(
instrid
=
RetrieveFromSymbolTable
(
instr
,
system_module_table_kind
)))
continue
;
if
(
instrid
->
ident_environ
!=
importingModule
)
continue
;
...
...
backendC/CleanCompilerSources/syntaxtr.t
View file @
ce662eca
...
...
@@ -51,7 +51,7 @@ typedef enum {
typedef
enum
{
int_type
,
bool_type
,
char_type
,
real_type
,
file_type
,
string_type
,
world_type
,
procid_type
,
file_type
,
string_type
,
world_type
,
procid_type
,
redid_type
,
#ifdef CLEAN2
rational_denot
,
...
...
@@ -114,7 +114,7 @@ typedef struct record_state_descr {
}
*RecordStateDescr
;
typedef
enum
{
SymbolIdTable
,
TypeSymbolIdTable
,
TypeVarIdTable
,
ModuleIdTable
,
FieldI
dTable
,
KeyWordTable
,
InternalIdTable
SymbolIdTable
,
TypeSymbolIdTable
,
ModuleIdTable
,
KeyWor
dTable
,
FirstSystemModuleTable
,
LastSystemModuleTable
=
0x7fff
}
TableKind
;
typedef
union
symb_value
{
...
...
@@ -720,6 +720,7 @@ struct def_repr {
SynTypes
dm_syn_types
;
AbsTypes
dm_abs_types
;
RuleTypes
dm_rules
;
TableKind
dm_system_module_table_kind
;
Bool
dm_system_module
;
#if WRITE_DCL_MODIFICATION_TIME
ModuleFileTime
dm_modification_time
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment