On Fri, 17 Feb 2023 14:35:45 GMT, Laurent Bourgès wrote:
> Or use #define KBD_BUF_LEN 256 And use it explicitely in array init &
> memmove... as plain old C.
Turns out C++ has an even more elegant solution for this: Passing an array by
reference https://github.com/openjdk/jdk/pull/19798/files
On Thu, 16 Feb 2023 15:33:51 GMT, Julian Waters wrote:
> In libawt, the size parameter is issued by a sizeof on an array, which as
> expected decays into a pointer and breaks the cleanup code by giving the
> incorrect size
Or use #define KBD_BUF_LEN 256
And use it explicitely in array init &
On Thu, 16 Feb 2023 15:33:51 GMT, Julian Waters wrote:
> In libawt, the size parameter is issued by a sizeof on an array, which as
> expected decays into a pointer and breaks the cleanup code by giving the
> incorrect size
Looking back at this now, I wonder if we should also have changed the
On Thu, 16 Feb 2023 15:33:51 GMT, Julian Waters wrote:
> In libawt, the size parameter is issued by a sizeof on an array, which as
> expected decays into a pointer and breaks the cleanup code by giving the
> incorrect size
Marked as reviewed by kcr (Author).
-
PR:
On Thu, 16 Feb 2023 16:42:05 GMT, Kevin Rushforth wrote:
> I just checked, and he is correct. In a function declaration, the array is
> treated as a pointer,
I see ..
-
PR: https://git.openjdk.org/jdk/pull/12597
On Thu, 16 Feb 2023 15:33:51 GMT, Julian Waters wrote:
> In libawt, the size parameter is issued by a sizeof on an array, which as
> expected decays into a pointer and breaks the cleanup code by giving the
> incorrect size
Marked as reviewed by prr (Reviewer).
-
PR:
On Thu, 16 Feb 2023 18:12:33 GMT, Sergey Bylokhov wrote:
>> In libawt, the size parameter is issued by a sizeof on an array, which as
>> expected decays into a pointer and breaks the cleanup code by giving the
>> incorrect size
>
> Interesting that this code can be compiled by gcc on windows.
On Thu, 16 Feb 2023 15:33:51 GMT, Julian Waters wrote:
> In libawt, the size parameter is issued by a sizeof on an array, which as
> expected decays into a pointer and breaks the cleanup code by giving the
> incorrect size
Marked as reviewed by serb (Reviewer).
Interesting that this code can
On Thu, 16 Feb 2023 17:56:54 GMT, Sergey Bylokhov wrote:
> Does anybody know how this was found, by some tool or compiler warning?
It was found by gcc, which will raise a noisy alert of
`-Wsizeof-array-argument` and `-Wsizeof-pointer-memaccess` when compiling
awt_Component.cpp:3402:38:
On Thu, 16 Feb 2023 15:33:51 GMT, Julian Waters wrote:
> In libawt, the size parameter is issued by a sizeof on an array, which as
> expected decays into a pointer and breaks the cleanup code by giving the
> incorrect size
Does anybody know how this was found, by some tool or compiler
On Thu, 16 Feb 2023 15:33:51 GMT, Julian Waters wrote:
> In libawt, the size parameter is issued by a sizeof on an array, which as
> expected decays into a pointer and breaks the cleanup code by giving the
> incorrect size
LGTM.
Length is 256*sizeof(BYTE) = 256.
-
PR:
On Thu, 16 Feb 2023 15:33:51 GMT, Julian Waters wrote:
> In libawt, the size parameter is issued by a sizeof on an array, which as
> expected decays into a pointer and breaks the cleanup code by giving the
> incorrect size
I just checked, and he is correct. In a function declaration, the
On Thu, 16 Feb 2023 15:33:51 GMT, Julian Waters wrote:
> In libawt, the size parameter is issued by a sizeof on an array, which as
> expected decays into a pointer and breaks the cleanup code by giving the
> incorrect size
Umm .. I'm not sure this is correct. Have you verified ?
On Thu, 16 Feb 2023 15:33:51 GMT, Julian Waters wrote:
> In libawt, the size parameter is issued by a sizeof on an array, which as
> expected decays into a pointer and breaks the cleanup code by giving the
> incorrect size
This looks bad. :-( Have you checked if this results in any
In libawt, the size parameter is issued by a sizeof on an array, which as
expected decays into a pointer and breaks the cleanup code by giving the
incorrect size
-
Commit messages:
- Brackets
- memmove decay error
Changes: https://git.openjdk.org/jdk/pull/12597/files
Webrev:
15 matches
Mail list logo