diff options
Diffstat (limited to 'gas/frags.c')
-rw-r--r-- | gas/frags.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gas/frags.c b/gas/frags.c index 882cb12..6518f37 100644 --- a/gas/frags.c +++ b/gas/frags.c @@ -74,11 +74,13 @@ frag_grow (nchars) frag_new (0); oldc = frchain_now->frch_obstack.chunk_size; frchain_now->frch_obstack.chunk_size = 2 * nchars + SIZEOF_STRUCT_FRAG; - while ((n = obstack_room (&frchain_now->frch_obstack)) < nchars) - { - frag_wane (frag_now); - frag_new (0); - } + if (frchain_now->frch_obstack.chunk_size > 0) + while ((n = obstack_room (&frchain_now->frch_obstack)) < nchars + && (unsigned long) frchain_now->frch_obstack.chunk_size > nchars) + { + frag_wane (frag_now); + frag_new (0); + } frchain_now->frch_obstack.chunk_size = oldc; } if (obstack_room (&frchain_now->frch_obstack) < nchars) |