diff --git a/main/gbc/gbc_dump.c b/main/gbc/gbc_dump.c index 1434ef46c..f6bfde550 100644 --- a/main/gbc/gbc_dump.c +++ b/main/gbc/gbc_dump.c @@ -324,14 +324,17 @@ static void export_type(TYPE type, bool scomma) static void export_signature(int nparam, int npmin, PARAM *param, bool vararg) { int i; + PARAM *p; for (i = 0; i < nparam; i++) { + p = ¶m[i]; + if (i == npmin) fprintf(_finfo, "["); - fprintf(_finfo, "(%s)", get_name(param[i].index)); - export_type(param[i].type, TRUE); + fprintf(_finfo, "(%s%s)", (p->byref ? "&" : ""), get_name(p->index)); + export_type(p->type, TRUE); } if (npmin < nparam) diff --git a/main/gbc/gbc_header.c b/main/gbc/gbc_header.c index d040f6270..bd7048ea2 100644 --- a/main/gbc/gbc_header.c +++ b/main/gbc/gbc_header.c @@ -166,6 +166,7 @@ static void analyze_function_desc(TRANS_FUNC *func, int flag) if (PATTERN_is(*look, RS_AT) || PATTERN_is(*look, RS_BYREF)) { + param->byref = TRUE; func->byref |= byref_mask; look++; } diff --git a/main/share/gbc_trans_common.h b/main/share/gbc_trans_common.h index 4ea690ad6..3ad278677 100644 --- a/main/share/gbc_trans_common.h +++ b/main/share/gbc_trans_common.h @@ -31,6 +31,7 @@ typedef PATTERN *optional; short value; unsigned ignore : 1; + unsigned byref : 1; } TRANS_PARAM;