[#41916] Proposal: Bitmap Marking GC — Narihiro Nakamura <authornari@...>

Hi.

18 messages 2012/01/05

[#41941] [ruby-trunk - Bug #5851][Open] make check fails when compiling with GCC 4.7 - *** longjmp causes uninitialized stack frame *** — Vit Ondruch <v.ondruch@...>

12 messages 2012/01/06

[#41979] [ruby-trunk - Bug #5865][Open] Exception#== should return false if the classes differ — Hiro Asari <asari.ruby@...>

10 messages 2012/01/08

[#42003] [ruby-trunk - Bug #5871][Open] regexp \W matches some word characters when inside a case-insensitive character class — Gareth Adams <gareth@...>

14 messages 2012/01/09

[#42016] [ruby-trunk - Feature #5873][Open] Adopt FFI over DL — Heesob Park <phasis@...>

15 messages 2012/01/10

[#42149] [ruby-trunk - Feature #5899][Open] chaining comparsions. — Ondrej Bilka <neleai@...>

12 messages 2012/01/16

[#42164] [ruby-trunk - Feature #5903][Open] Optimize st_table (take 2) — Yura Sokolov <funny.falcon@...>

18 messages 2012/01/17

[ruby-core:42134] Re: [ruby-trunk - Bug #5888][Assigned] JSON unittest fails

From: Eric Wong <normalperson@...>
Date: 2012-01-15 07:56:42 UTC
List: ruby-core #42134
Yui NARUSE <naruse@airemix.jp> wrote:
> filed it to GCC's tracker.

I don't believe this is a GCC bug: space for buf[4] can be reclaimed
as soon as execution finishes in the scope where buf[4] was declared.

> For JSON, following is simple patch:

This was always a bug, we were just lucky because GCC wasn't as
aggressive when popping the stack.

> diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c
> index d1d14c7..1773616 100644
> --- a/ext/json/parser/parser.c
> +++ b/ext/json/parser/parser.c
> @@ -1293,6 +1293,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
>  {
>      char *p = string, *pe = string, *unescape;
>      int unescape_len;
> +    char buf[4];
> 
>      while (pe < stringEnd) {
>          if (*pe == '\\') {
> @@ -1325,7 +1326,6 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
>                      if (pe > stringEnd - 4) {
>                          return Qnil;
>                      } else {
> -                        char buf[4];
>                          UTF32 ch = unescape_unicode((unsigned char *) ++pe);
>                          pe += 3;
>                          if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
> ----------------------------------------

In This Thread