aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-02-13 15:46:26 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-02-13 15:46:26 +0000
commitd6e2c7cf08df73503b81cf901de3a3b2b278c2c5 (patch)
treed86061fe18984febe388427c5967c8f33936f62f /src/opts
parent632151bc91614fd69481458091fb37b86b7df2ce (diff)
Prevent the memset16 ARM opt from failing when count is 0.
Review URL: http://codereview.appspot.com/5639051 git-svn-id: http://skia.googlecode.com/svn/trunk@3173 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/opts')
-rw-r--r--src/opts/memset.arm.S9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/opts/memset.arm.S b/src/opts/memset.arm.S
index bc0c060ac9..1248631c16 100644
--- a/src/opts/memset.arm.S
+++ b/src/opts/memset.arm.S
@@ -32,6 +32,10 @@ arm_memset16:
.fnstart
push {lr}
+ /* if count is equal to zero then abort */
+ teq r2, #0
+ ble .Lfinish
+
/* Multiply count by 2 - go from the number of 16-bit shorts
* to the number of bytes desired. */
mov r2, r2, lsl #1
@@ -52,6 +56,10 @@ arm_memset32:
.fnstart
push {lr}
+ /* if count is equal to zero then abort */
+ teq r2, #0
+ ble .Lfinish
+
/* Multiply count by 4 - go from the number of 32-bit words to
* the number of bytes desired. */
mov r2, r2, lsl #2
@@ -97,5 +105,6 @@ arm_memset32:
strcs r1, [r0], #4
strmih lr, [r0], #2
+.Lfinish:
pop {pc}
.fnend