From: uz Date: Sat, 21 Jan 2012 21:35:49 +0000 (+0000) Subject: Fixed an internal error that was triggered by an attempt to move an empty list X-Git-Tag: V2.13.3~46 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=44e7225ce6fc5ae5b153b932ab00b41d46fe4dc2;p=cc65 Fixed an internal error that was triggered by an attempt to move an empty list of instructions in the code segment (Oliver Schmidt). git-svn-id: svn://svn.cc65.org/cc65/trunk@5419 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/codeseg.c b/src/cc65/codeseg.c index 52516abfe..fff502d3e 100644 --- a/src/cc65/codeseg.c +++ b/src/cc65/codeseg.c @@ -655,6 +655,11 @@ void CS_MoveEntries (CodeSeg* S, unsigned Start, unsigned Count, unsigned NewPos * current code end) */ { + /* Transparently handle an empty range */ + if (Count == 0) { + return; + } + /* If NewPos is at the end of the code segment, move any labels from the * label pool to the first instruction of the moved range. */