notaz.gp2x.de
/
ia32rtools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
092f64e
)
translate: change how things end
author
notaz
<notasas@gmail.com>
Mon, 17 Feb 2014 02:50:09 +0000
(
04:50
+0200)
committer
notaz
<notasas@gmail.com>
Mon, 17 Feb 2014 02:50:09 +0000
(
04:50
+0200)
tools/translate.c
patch
|
blob
|
blame
|
history
diff --git
a/tools/translate.c
b/tools/translate.c
index
e3d8f5b
..
7becbdd
100644
(file)
--- a/
tools/translate.c
+++ b/
tools/translate.c
@@
-4745,6
+4745,9
@@
static void scan_ahead(FILE *fasm)
add_func_chunk(fasm, words[0], asmln);
}
add_func_chunk(fasm, words[0], asmln);
}
+ else if (IS_START(p, "; sctend"))
+ break;
+
continue;
} // *p == ';'
continue;
} // *p == ';'
@@
-4790,6
+4793,7
@@
int main(int argc, char *argv[])
int eq_alloc;
int verbose = 0;
int multi_seg = 0;
int eq_alloc;
int verbose = 0;
int multi_seg = 0;
+ int end = 0;
int arg_out;
int arg;
int pi = 0;
int arg_out;
int arg;
int pi = 0;
@@
-5020,6
+5024,11
@@
parse_words:
if (IS_START(p, "; sctproto:")) {
sctproto = strdup(p + 11);
}
if (IS_START(p, "; sctproto:")) {
sctproto = strdup(p + 11);
}
+ else if (IS_START(p, "; sctend")) {
+ end = 1;
+ if (!pending_endp)
+ break;
+ }
}
if (wordc == 0) {
}
if (wordc == 0) {
@@
-5040,7
+5049,7
@@
parse_words:
do_pending_endp:
// do delayed endp processing to collect switch jumptables
if (pending_endp) {
do_pending_endp:
// do delayed endp processing to collect switch jumptables
if (pending_endp) {
- if (in_func && !skip_func && wordc >= 2
+ if (in_func && !skip_func &&
!end &&
wordc >= 2
&& ((words[0][0] == 'd' && words[0][2] == 0)
|| (words[1][0] == 'd' && words[1][2] == 0)))
{
&& ((words[0][0] == 'd' && words[0][2] == 0)
|| (words[1][0] == 'd' && words[1][2] == 0)))
{
@@
-5123,6
+5132,9
@@
do_pending_endp:
}
g_func_pd_cnt = 0;
pd = NULL;
}
g_func_pd_cnt = 0;
pd = NULL;
+
+ if (end)
+ break;
if (wordc == 0)
continue;
}
if (wordc == 0)
continue;
}
@@
-5187,8
+5199,12
@@
do_pending_endp:
}
if (wordc == 2 && IS(words[1], "ends")) {
}
if (wordc == 2 && IS(words[1], "ends")) {
- if (!multi_seg)
+ if (!multi_seg) {
+ end = 1;
+ if (pending_endp)
+ goto do_pending_endp;
break;
break;
+ }
// scan for next text segment
while (fgets(line, sizeof(line), fasm)) {
// scan for next text segment
while (fgets(line, sizeof(line), fasm)) {