[cfe-commits] r151927 - in /cfe/trunk/lib/CodeGen: CGBuiltin.cpp CodeGenFunction.h
Chris Lattner
clattner at apple.com
Sat Mar 3 16:57:09 PST 2012
On Mar 3, 2012, at 1:47 PM, Richard Smith wrote:
> Hi,
>
> This asserts in cases where memset is given a pointer to incomplete type. Testcase:
>
> typedef unsigned long size_t;
> typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t;
> size_t snd_pcm_hw_params_sizeof(void);
> #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
> #define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
> int sa_stream_open() {
> snd_pcm_hw_params_t* hwparams;
> snd_pcm_hw_params_alloca(&hwparams);
> }
>
Fixed in r151993, thanks!
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120303/bd382ac8/attachment.html>
More information about the cfe-commits
mailing list