Skip to content

Instantly share code, notes, and snippets.

diff --git a/insns.def b/insns.def
index c339180..9be0eda 100644
--- a/insns.def
+++ b/insns.def
@@ -765,13 +765,10 @@ defined
}
break;
case DEFINED_ZSUPER:{
- const rb_method_entry_t *me = GET_CFP()->me;
- if (me) {
@wanabe
wanabe / gist:5565338
Created May 12, 2013 23:23
patch for Wine to work CRuby on.
diff --git a/dlls/msvcr100/msvcr100.c b/dlls/msvcr100/msvcr100.c
index 149f132..a7cf2ac 100644
--- a/dlls/msvcr100/msvcr100.c
+++ b/dlls/msvcr100/msvcr100.c
@@ -497,6 +497,7 @@ BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hdll);
_set_printf_count_output(0);
+ ((char**)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "__pioinfo"))[2048/32] = (char*)-1;
}
class TextView < import("android/widget")
define_init "Landroid/content/Context;"
define :setText, "Ljava/lang/CharSequence;", "V"
end
class Mred < JavaMain
define :setContentView, "Landroid/view/View;", "V"
def initialize
textview = TextView.new(self)
textview.setText("hello from mruby")
diff --git a/src/class.c b/src/class.c
index a50d3d8..9080265 100644
--- a/src/class.c
+++ b/src/class.c
@@ -78,8 +78,14 @@ prepare_singleton_class(mrb_state *mrb, struct RBasic *o)
}
else if (o->tt == MRB_TT_SCLASS) {
c = (struct RClass*)o;
- make_metaclass(mrb, c->super);
- sc->super = c->super->c;
diff --git a/src/backtrace.c b/src/backtrace.c
index e05ad43..20ccaa7 100644
--- a/src/backtrace.c
+++ b/src/backtrace.c
@@ -7,18 +7,65 @@
#include "mruby.h"
#include "mruby/variable.h"
#include "mruby/proc.h"
+#include "mruby/array.h"
+#include "mruby/string.h"
@wanabe
wanabe / gist:8935856
Created February 11, 2014 14:31
count function in-out
#define COUNT_INOUT(type, ret, name, _args, args_raw) \
static int name##_count;\
type inline __##name _args;\
type name _args {\
int aaaa = ++name##_count;\
fprintf(stderr, "" #name " >> %06i\n", aaaa);fflush(stderr);\
ret retval = __##name args_raw;\
fprintf(stderr, "" #name " << %06i\n", aaaa);fflush(stderr);\
return retval;\
}\
@wanabe
wanabe / slash.txt
Last active August 29, 2015 13:57
ななめの種
#1685 Windows の Unicode パスがまだおかしい
#2567 Net::HTTP がエンコーディングをセットしてくれない
#3348 Kernel.spawn で標準入力と標準エラーを同一の新規ファイルにリダイレクトさせたい
#3526 ヌルデバイスへのパスを示す IO::NULL の提案
#4008 Rails 3 on 1.9.2-p0 で SEGV
#4276 ハッシュを {"including space": val} とか書きたい
#4788 resolv.rb のリファクタリング
#5328 instance_exec/class_exec 内で引数展開がおかしい
#5330 間違ったバックトレースの行番号が返される
#5463 PTY か IO.select がタイミングによっておかしな挙動をする
@wanabe
wanabe / slash.rb
Last active August 29, 2015 13:57
ななめ作り
mtime = File.mtime($0) - 1
Dir.chdir(ARGV[0] || File.dirname($0))
loop do
sleep 1
if File.exist?($0) && File.mtime($0) > mtime
mtime = File.mtime($0)
print "starting... "
open($0) do |f|
nil until f.gets =~ /^__END__$/
open("result.log", "w") do |w|
source "https://rubygems.org"
gem "msgpack-rpc"