[Bug 15033] intermittant crashes while playing bf1942

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Sep 4 02:30:19 CDT 2008


http://bugs.winehq.org/show_bug.cgi?id=15033





--- Comment #11 from Jeff Zaroyko <jeffzaroyko at gmail.com>  2008-09-04 02:30:19 ---
(In reply to comment #10)
> +    char pgmbuffer[SHADER_PGMSIZE];
> 
> -    buffer.buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
> SHADER_PGMSIZE);
> +    buffer.buffer = (char *)&pgmbuffer;
> 
> That looks wrong
> 
> +    buffer.buffer = pgmbuffer;
> 
> Should be right
> 
> char *foo;
> char foo[5];
> 
> The only difference between the two is that the former requires a malloc and
> the latter is of a fixed size.
> 

It's not wrong, just redundant.  The value of an array is a pointer to its
first element, the addressof (&) the array is a pointer to an array of char of
size SHADER_PGMSIZE and then casting that to char * is equivalent.   It doesn't
matter anyway, Stefan has pointed out that the patch is wrong due to the
problem being elsewhere.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list