Project

General

Profile

Actions

Bug #1161

closed

Build Assertion Failure with VC+++ - Unitialized variable in rb_define_hooked_variable

Added by cfis (Charlie Savage) about 16 years ago. Updated about 14 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32_90]
Backport:
[ruby-core:22115]

Description

=begin
Build ruby 1.9.1 with VC 2008 using the following flags:

RUNTIMEFLAG = -MDd
OPTFLAGS = -Od -RTC1
LDFLAGS = -link -INCREMENTAL:NO -DEBUG -OPT:REF -OPT:ICF

Failure occurs when running miniruby.exe for the first time:

Run-Time Check Failure #3 - The variable 'tmp' is being used without being initialized.

This patch fixes the problem:

--- variable.c 2009-02-14 14:18:26 -0700
+++ variable.old.c 2009-02-14 14:16:05 -0700
@@ -484,8 +484,7 @@
gvar->setter = setter?(gvar_setter_t *)setter:var_setter;
gvar->marker = var_marker;

  • if (var)
  •  RB_GC_GUARD(tmp);
    
  • RB_GC_GUARD(tmp);
    }

void
=end

Actions #1

Updated by cfis (Charlie Savage) about 16 years ago

=begin
Sorry, reversed the patch. It should be:

--- variable.old.c 2009-02-14 14:16:05 -0700
+++ variable.c 2009-02-14 14:20:44 -0700
@@ -484,7 +484,8 @@
gvar->setter = setter?(gvar_setter_t *)setter:var_setter;
gvar->marker = var_marker;

  • RB_GC_GUARD(tmp);
  • if (var)
  •  RB_GC_GUARD(tmp);
    

}

void

=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) about 16 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r22322.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0