w6a: raise symbol-name buffer cap 64->256 (M1 prep)
Dotted import paths lengthen mangled symbols; the assembler's fixed symbol/TEXT/DATA name buffers must not silently truncate a mangled name into a collision. Byte-id-neutral: no current symbol reaches 63 chars. wwstage w6a already parses symbols via dynamic dupstr, so no mirror cap exists there.
This commit is contained in:
@@ -210,9 +210,9 @@ parse_operand(Asm *a, const char *s, Aoperand *out)
|
|||||||
|
|
||||||
/* IDENT — register or symbol-or-label */
|
/* IDENT — register or symbol-or-label */
|
||||||
if (a_isidstart((unsigned char)*s)) {
|
if (a_isidstart((unsigned char)*s)) {
|
||||||
char buf[64] = {0};
|
char buf[256] = {0};
|
||||||
int n = 0;
|
int n = 0;
|
||||||
while (a_isidcont((unsigned char)*s) && n < 63) buf[n++] = *s++;
|
while (a_isidcont((unsigned char)*s) && n < 255) buf[n++] = *s++;
|
||||||
buf[n] = 0;
|
buf[n] = 0;
|
||||||
|
|
||||||
/* Optional `+disp` between the ident and `(SB)`. Used by
|
/* Optional `+disp` between the ident and `(SB)`. Used by
|
||||||
@@ -333,9 +333,9 @@ a_parse(Asm *a)
|
|||||||
|
|
||||||
if (op == A_TEXT) {
|
if (op == A_TEXT) {
|
||||||
/* TEXT name,$framesize */
|
/* TEXT name,$framesize */
|
||||||
char nbuf[64] = {0};
|
char nbuf[256] = {0};
|
||||||
int nn = 0;
|
int nn = 0;
|
||||||
while (*m && *m != ',' && nn < 63) nbuf[nn++] = *m++;
|
while (*m && *m != ',' && nn < 255) nbuf[nn++] = *m++;
|
||||||
prg->to.type = D_EXTERN;
|
prg->to.type = D_EXTERN;
|
||||||
prg->to.sym = strdup(nbuf);
|
prg->to.sym = strdup(nbuf);
|
||||||
if (*m == ',') {
|
if (*m == ',') {
|
||||||
@@ -347,9 +347,9 @@ a_parse(Asm *a)
|
|||||||
} else if (op == A_DATA || op == A_DATAW) {
|
} else if (op == A_DATA || op == A_DATAW) {
|
||||||
/* DATA name(SB),"escaped bytes" — read-only in .text
|
/* DATA name(SB),"escaped bytes" — read-only in .text
|
||||||
* DATAW name(SB),"escaped bytes" — writable in .data */
|
* DATAW name(SB),"escaped bytes" — writable in .data */
|
||||||
char nbuf[128] = {0};
|
char nbuf[256] = {0};
|
||||||
int nn = 0;
|
int nn = 0;
|
||||||
while (*m && *m != '(' && nn < 127) nbuf[nn++] = *m++;
|
while (*m && *m != '(' && nn < 255) nbuf[nn++] = *m++;
|
||||||
prg->to.type = D_EXTERN;
|
prg->to.type = D_EXTERN;
|
||||||
prg->to.sym = strdup(nbuf);
|
prg->to.sym = strdup(nbuf);
|
||||||
if (*m == '(') {
|
if (*m == '(') {
|
||||||
|
|||||||
Reference in New Issue
Block a user