[PATCH] Changed loop variable from int to uint32_t in llvm-cov

Yuchen Wu yuchenericwu at hotmail.com
Tue Oct 22 13:31:01 PDT 2013

The loop itself would not break but the use of an negative integer as an index would break, no?

Subject: Re: [PATCH] Changed loop variable from int to uint32_t in llvm-cov
From: bob.wilson at apple.com
Date: Tue, 22 Oct 2013 13:08:49 -0700
CC: llvm-commits at cs.uiuc.edu
To: yuchenericwu at hotmail.com

I don't think there is a real problem with overflow here because the loop exit conditions are using != comparisons.  Even if the int values overflow, that should not change the behavior of those comparisons.  (It would be different for less-than and greater-than comparisons.)  But, I've applied your patch anyway since it makes sense to be consistent with the types used for the loop bounds.  r193192
On Oct 22, 2013, at 10:52 AM, Yuchen Wu <yuchenericwu at hotmail.com> wrote:Changed a couple of loop variables in llvm-cov to uint32_t when the condition statement contains a comparison to uint32_t.<0005-Changed-index-variable-from-int-to-uint32_t.patch>_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131022/6832b7c7/attachment.html>

More information about the llvm-commits mailing list