Commit 4ea9b082 authored by John van Groningen's avatar John van Groningen
Browse files

fix names and export labels of tuple selectors > 6 if exporting local labels

parent ff78e5e4
......@@ -267,12 +267,23 @@ void ConvertSymbolToRLabel (LabDef *slab,SymbDef sdef)
MakeSymbolLabel (slab,modname,r_pref,sdef,0);
}
static SymbDefS lazy_tuple_selector_sdef;
static IdentS lazy_tuple_selector_ident;
void BuildLazyTupleSelectorLabel (Label slab, int arity, int argnr)
{
if (argnr > NrOfGlobalSelectors){
LazyTupleSelectors [argnr - NrOfGlobalSelectors- 1] = True;
MakeLabel (slab,loc_sel,argnr,n_pref);
} else
if (ExportLocalLabels){
lazy_tuple_selector_sdef.sdef_exported=True;
lazy_tuple_selector_sdef.sdef_ident=&lazy_tuple_selector_ident;
lazy_tuple_selector_ident.ident_name=loc_sel;
MakeSymbolLabel (slab,CurrentModule,n_pref,&lazy_tuple_selector_sdef,argnr);
} else {
LazyTupleSelectors [argnr - NrOfGlobalSelectors- 1] = True;
MakeLabel (slab,loc_sel,argnr,n_pref);
}
} else
MakeLabel (slab,glob_sel,argnr,n_pref);
}
......
......@@ -3595,12 +3595,30 @@ void GenStart (SymbDef startsymb)
#ifdef NEW_SELECTOR_DESCRIPTORS
void GenSelectorDescriptor (Label sellab,int element_n)
{
if (sellab->lab_issymbol){
char *name;
name=sellab->lab_symbol->sdef_ident->ident_name;
put_directive_ (Dexport);
FPrintF (OutFile, "e_%s_" D_PREFIX "%s.%d",sellab->lab_mod, name, sellab->lab_post);
put_directive_ (Dexport);
FPrintF (OutFile, "e_%s_%s%s.%d",sellab->lab_mod, sellab->lab_pref, name, sellab->lab_post);
put_directive_ (Ddescs);
FPrintF (OutFile, "e_%s_" D_PREFIX "%s.%d e_%s_%s%s.%d _ %d 0 \"%s.%d\"",
sellab->lab_mod, name, sellab->lab_post,
sellab->lab_mod, sellab->lab_pref, name, sellab->lab_post,
element_n+1,
name, sellab->lab_post);
} else {
put_directive_ (Ddescs);
FPrintF (OutFile, D_PREFIX "%s.%d %s%s.%d _ %d 0 \"%s.%d\"",
sellab->lab_name, sellab->lab_post,
sellab->lab_pref, sellab->lab_name, sellab->lab_post,
element_n+1,
sellab->lab_name, sellab->lab_post);
}
}
#else
void GenSelectorDescriptor (Label sellab,char *g_pref)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment