From d6e2c7cf08df73503b81cf901de3a3b2b278c2c5 Mon Sep 17 00:00:00 2001 From: "djsollen@google.com" Date: Mon, 13 Feb 2012 15:46:26 +0000 Subject: 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 --- src/opts/memset.arm.S | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/opts') 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 -- cgit v1.2.3