From d8aa5f2b0d6803e9654e83eec8d1bcef61c8cdb0 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Sat, 19 Oct 2013 19:00:08 +0200 Subject: [PATCH] Add patches for ruby source tree --- patches/ruby/marshal_utf8.patch | 15 +++++++++++++++ patches/ruby/unused_param.patch | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 patches/ruby/marshal_utf8.patch create mode 100644 patches/ruby/unused_param.patch diff --git a/patches/ruby/marshal_utf8.patch b/patches/ruby/marshal_utf8.patch new file mode 100644 index 0000000..64e58f0 --- /dev/null +++ b/patches/ruby/marshal_utf8.patch @@ -0,0 +1,15 @@ +diff --git a/marshal.c b/marshal.c +index 4cba05d..dfce6ee 100644 +--- a/marshal.c ++++ b/marshal.c +@@ -1312,7 +1312,9 @@ r_unique(struct load_arg *arg) + static VALUE + r_string(struct load_arg *arg) + { +- return r_bytes(arg); ++ VALUE str = r_bytes(arg); ++ rb_enc_associate(str, rb_utf8_encoding()); ++ return str; + } + + static VALUE diff --git a/patches/ruby/unused_param.patch b/patches/ruby/unused_param.patch new file mode 100644 index 0000000..d7f2cb9 --- /dev/null +++ b/patches/ruby/unused_param.patch @@ -0,0 +1,25 @@ +diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h +index 0a8407a..22dff42 100644 +--- a/include/ruby/ruby.h ++++ b/include/ruby/ruby.h +@@ -1207,6 +1207,9 @@ rb_obj_wb_unprotect(VALUE x, const char *filename, int line) + RGENGC_LOGGING_WB_UNPROTECT((void *)x, filename, line); + #endif + ++ (void) filename; ++ (void) line; ++ + #if USE_RGENGC + /* `x' should be an RVALUE object */ + if (FL_TEST_RAW((x), FL_WB_PROTECTED)) { +@@ -1227,6 +1230,10 @@ rb_obj_written(VALUE a, VALUE oldv, VALUE b, const char *filename, int line) + RGENGC_LOGGING_OBJ_WRITTEN(a, oldv, b, filename, line); + #endif + ++ (void) oldv; ++ (void) filename; ++ (void) line; ++ + #if USE_RGENGC + /* `a' should be an RVALUE object */ + if (FL_TEST_RAW((a), FL_OLDGEN) &&