Bug #12611 closed
Fragment N1: GetBindingPtr()
is a macro that assigns the argued variable.
Fragment N2: we have our dedicated realloc()
implementation that behaves differently than you assume (it bails out for errors).
Fragment N3: CreateSymbolicLinkW()
does return boolean, no data loss.
Fragment N4: This is not an error like you commented, but I admit this is a bad habit.
Thank you for the report. I see no fatal errors. N4 is the only thing that I think worth fixing.
Shyouhei Urabe wrote:
Fragment N1: GetBindingPtr()
is a macro that assigns the argued variable.
It will cause no actual harm, but I think "if (bind && ...) {
" seems pointless as OP said.
Fragment N2: we have our dedicated realloc()
implementation that behaves differently than you assume (it bails out for errors).
Really? It is realloc
, not xrealloc
. I cannot find a macro like "#define realloc ..." in win32/file.c
.
Fragment N3: CreateSymbolicLinkW()
does return boolean, no data loss.
Then, I wonder why create_symbolic_link_func
is declared so that it returns DWORD
.
--
Yusuke Endoh mame@ruby-lang.org
Yusuke Endoh wrote:
Fragment N2: we have our dedicated realloc()
implementation that behaves differently than you assume (it bails out for errors).
Really? It is realloc
, not xrealloc
. I cannot find a macro like "#define realloc ..." in win32/file.c
.
Yes, it isn't xrealloc
, but table
is a copy of cp->table
and the original pointer is kept even when realloc
failed.
Nobuyoshi Nakada wrote:
Yusuke Endoh wrote:
Fragment N2: we have our dedicated realloc()
implementation that behaves differently than you assume (it bails out for errors).
Really? It is realloc
, not xrealloc
. I cannot find a macro like "#define realloc ..." in win32/file.c
.
Yes, it isn't xrealloc
, but table
is a copy of cp->table
and the original pointer is kept even when realloc
failed.
Sorry. I was wrong here.
Status changed from Open to Closed
Applied in changeset r55729.
Fix Issues reported by PVS-Studio static analyzer
vm.c (vm_set_main_stack): remove unnecessary check. toplevel
binding must be initialized. [Bug #12611 ] (N1)
win32/win32.c (w32_symlink): fix return type. [Bug #12611 ] (N3)
string.c (rb_str_split_m): simplify the condition.
Bug #12611
Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: WONTFIX, 2.2: REQUIRED, 2.3: REQUIRED
Backport changed from 2.1: WONTFIX, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: WONTFIX, 2.2: DONE, 2.3: REQUIRED
ruby_2_2 r55925 merged revision(s) 55729.
Backport changed from 2.1: WONTFIX, 2.2: DONE, 2.3: REQUIRED to 2.1: WONTFIX, 2.2: DONE, 2.3: DONE
ruby_2_3 r55959 merged revision(s) 55729.
Also available in: Atom
PDF
Like 0
Like 0 Like 0 Like 0 Like 0 Like 0 Like 0 Like 0 Like 0