In: manveru
By: manveru

Pastr by manveru

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff --git a/vm/builtin/regexp.cpp b/vm/builtin/regexp.cpp
index 4ff9159..858db2a 100644
--- a/vm/builtin/regexp.cpp
+++ b/vm/builtin/regexp.cpp
@@ -246,8 +246,8 @@ namespace rubinius {
end = pat + pattern->size(); opts = options->to_native();
- kcode = opts & KCODE_MASK;
- opts &= OPTION_MASK;
+ kcode = opts & rb_const_get(rb_cRegexp, rb_intern("OPTION_MASK"));
+ opts &= rb_const_get(rb_cRegexp, rb_intern("OPTION_MASK"));
if(kcode == 0) { enc = current_encoding(state);
@@ -299,11 +299,12 @@ namespace rubinius {
} Object* Regexp::options(STATE) {
- regex_t* reg;
+ regex_t* reg;
+ int option_mask;
- reg = onig_data;
-
- int result = ((int)onig_get_options(reg) & OPTION_MASK);
+ reg = onig_data;
+ option_mask = rb_const_get(rb_cRegexp, rb_intern("OPTION_MASK"));
+ int result = ((int)onig_get_options(reg) & option_mask);
if(forced_encoding_) { result |= get_kcode_from_enc(onig_get_encoding(reg));

Plain Text Version Annotate this paste

Wikipedia...keep it free. Click here to lend your support to: ramaze and make a donation at www.pledgie.com !