Le 7 juil. 2010 à 08:54, Greg Guerin a écrit : > vincent habchi wrote: > >> The analyzer does not figure out that the pt array gets initialized through >> the loop by copying values directly from a chunk of memory, and spits out >> the warning about pt [•] not being defined. Maybe I should report this to >> the LLVM team? > > > That seems like a good idea. > > However, also consider that 'dim' may take on values 0 or 1. If dim is 0 or > 1, then the local 'pt' array may not have valid elements at pt[0] or pt[1]. > You may know that dim is never 0 or 1, but the analyzer has no way of knowing > that. > > And I don't know what might happen if dim is negative.
That's true, the compiler cannot guarantee that dim > 1, which is always the case actually. I am going to put an extra text at the beginning of the method, like: "if (dim < 1) return;" and see what happens. Vincent _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
