Index: gcc/melt-runtime.c =================================================================== --- gcc/melt-runtime.c (revision 175348) +++ gcc/melt-runtime.c (working copy) @@ -6292,6 +6292,7 @@ struct reading_st int rcol; /* current column */ source_location rsrcloc; /* current source location */ melt_ptr_t *rpfilnam; /* pointer to location of file name string */ + bool has_file_location; /* precise if the string comes from a file */ }; #define MELT_READ_TABULATION_FACTOR 8 @@ -6326,7 +6327,7 @@ melt_linemap_compute_current_location (struct read { int colnum = 1; int cix = 0; - if (!rd || !rd->rcurlin) + if (!rd || !rd->rcurlin || !rd->has_file_location) return; for (cix=0; cixrcol; cix++) { char c = rd->rcurlin[cix]; @@ -8314,6 +8315,7 @@ meltgc_read_file (const char *filnam, const char * rd = &rds; locnamv = meltgc_new_stringdup ((meltobject_ptr_t) MELT_PREDEF (DISCR_STRING), locnam); rds.rpfilnam = (melt_ptr_t *) & locnamv; + rds.has_file_location = true; seqv = meltgc_new_list ((meltobject_ptr_t) MELT_PREDEF (DISCR_LIST)); while (!rdeof ()) { @@ -8371,7 +8373,16 @@ meltgc_read_from_rawstring (const char *rawstr, co rds.rsrcloc = loch; rd = &rds; if (locnam) - locnamv = meltgc_new_stringdup ((meltobject_ptr_t) MELT_PREDEF (DISCR_STRING), locnam); + { + rds.has_file_location = true; + locnamv = meltgc_new_stringdup ((meltobject_ptr_t) MELT_PREDEF (DISCR_STRING), locnam); + } + else + { + rds.has_file_location = false; + locnamv = meltgc_new_string ((meltobject_ptr_t) MELT_PREDEF(DISCR_STRING), + "stringBuffer"); + } seqv = meltgc_new_list ((meltobject_ptr_t) MELT_PREDEF (DISCR_LIST)); rds.rpfilnam = (melt_ptr_t *) & locnamv; while (rdcurc ()) @@ -8415,6 +8426,7 @@ meltgc_read_from_val (melt_ptr_t strv_p, melt_ptr_ locnamv = locnam_p; rbuf = 0; strmagic = melt_magic_discr ((melt_ptr_t) strv); + seqv = meltgc_new_list ((meltobject_ptr_t) MELT_PREDEF (DISCR_LIST)); switch (strmagic) { case MELTOBMAG_STRING: @@ -8441,7 +8453,14 @@ meltgc_read_from_val (melt_ptr_t strv_p, melt_ptr_ rds.rpath = 0; rds.rlineno = 0; rds.rcurlin = rbuf; + rds.has_file_location = true; rd = &rds; + if (locnamv == NULL){ + rds.has_file_location = false; + locnamv = meltgc_new_string ((meltobject_ptr_t) MELT_PREDEF(DISCR_STRING), + "stringBuffer"); + rd->rpfilnam = (melt_ptr_t *) &locnamv; + } rds.rpfilnam = (melt_ptr_t *) & locnamv; while (rdcurc ()) {