summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2001-04-04 22:50:57 +0000
committerken <ken@FreeBSD.org>2001-04-04 22:50:57 +0000
commitd5dead39709dcee38811dc4233580bdc17e9cc10 (patch)
treefe4eb88e87bc3ddadefe6545acfba7b4ed4a310f
parent44f132def73a73ef49478fd52284a38cb165cb63 (diff)
downloadFreeBSD-src-d5dead39709dcee38811dc4233580bdc17e9cc10.zip
FreeBSD-src-d5dead39709dcee38811dc4233580bdc17e9cc10.tar.gz
Don't allow immediate values of 0 for operations that can take either an
immediate value or the accumulator. 0 is the chip's internal representation for the accumulator, and so 0 is an invalid immediate value when the accumulator can also be specified as an argument. Submitted by: gibbs
-rw-r--r--sys/dev/aic7xxx/aicasm/aicasm_gram.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y
index d0bc671..91425f3 100644
--- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y
+++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y
@@ -623,6 +623,11 @@ immediate_or_a:
expression
{
$$ = $1;
+ if ($$.value == 0) {
+ stop("Immediate value of 0 not valid for opcode",
+ EX_DATAERR);
+ /* NOTREACHED */
+ }
}
| T_A
{
OpenPOWER on IntegriCloud