Don't create code for a subtraction of zero
git-svn-id: svn://svn.cc65.org/cc65/trunk@267 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -3191,6 +3191,11 @@ void g_inc (unsigned flags, unsigned long val)
|
|||||||
void g_dec (unsigned flags, unsigned long val)
|
void g_dec (unsigned flags, unsigned long val)
|
||||||
/* Decrement the primary register by a given number */
|
/* Decrement the primary register by a given number */
|
||||||
{
|
{
|
||||||
|
/* Don't dec by zero */
|
||||||
|
if (val == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Generate code for the supported types */
|
/* Generate code for the supported types */
|
||||||
flags &= ~CF_CONST;
|
flags &= ~CF_CONST;
|
||||||
switch (flags & CF_TYPE) {
|
switch (flags & CF_TYPE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user