Skip to content

Instantly share code, notes, and snippets.

Source
_global_ = 1
class Blah
def foo(a, b)
c = a._op_plus(b)
_global_.print(c)
end
end
def self.first_uninteresting
numbers = all(:order=>:number, :conditions=>"number >= 0").map(&:number)
highest = numbers.sort.last
missing = (1..highest).to_a - numbers
return highest + 1 if missing.empty?
missing.first
end
class String
@@words = File.open("dictionary").read.split
def self.words
@@words
end
def is_word?
@@words.include? self
end
Running 686 tests.................
In TestBignum::test_from_int:
./vm/test/test_bignum.hpp:31: Error: Expected (2147483647 == obj->to_native()), found (2147483647 != -1879048193)
..
In TestBignum::test_from_long:
./vm/test/test_bignum.hpp:47: Error: Expected (2147483647L == obj->to_long()), found (2147483647 != -1879048193)
In TestBignum::test_from_long_negative:
./vm/test/test_bignum.hpp:53: Error: Expected ((long)0x80000000L == obj->to_long()), found (-? != 0)
In TestBignum::test_from_unsigned_long:
./vm/test/test_bignum.hpp:58: Error: Expected (4294967295LU == obj->to_ulong()), found (4294967295 != 2415919103)
#define rb_jgParticleWrap(particle) \
Data_Wrap_Struct(c_jgParticle, NULL, NULL, (particle))
VALUE rb_jgAreaWrap(jgArea *area)
{
VALUE wrappedArea = Data_Wrap_Struct(c_jgArea, NULL, NULL, area);
VALUE *particles = malloc(area->particles->length * sizeof(VALUE));
for(int i = 0; i < area->particles->length; i++)
particles[i] = rb_jgParticleWrap(area->particles->arr[i]);
class Class
attr_reader :conditional_methods
def defined_when(name, condition, &method)
@conditional_methods ||= {}
@conditional_methods[name.to_sym] = condition
define_method(name) do
if self.instance_eval(&condition)
self.instance_eval(&method)
diff --git a/rakelib/vm.rake b/rakelib/vm.rake
index 0deff79..73e3641 100644
--- a/rakelib/vm.rake
+++ b/rakelib/vm.rake
@@ -665,7 +665,7 @@ file dep_file => EXTERNALS + srcs + hdrs + vm_srcs + generated + %w[vm/gen/instr
includes = INCLUDES.join ' '
flags = FLAGS.join ' '
- flags << " -D__STDC_LIMIT_MACROS"
+ flags << " -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/mitchell/dev/rubinius/bin/rbx
[Thread debugging using libthread_db enabled]
[New Thread 0xb7d706d0 (LWP 20642)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d706d0 (LWP 20642)]
diff --git a/vm/llvm/inline.cpp b/vm/llvm/inline.cpp
index 39174f6..e4eabd7 100644
--- a/vm/llvm/inline.cpp
+++ b/vm/llvm/inline.cpp
@@ -148,12 +148,12 @@ namespace rubinius {
case InstructionSequence::insn_push_int:
val = ops_.constant(Fixnum::from(stream[1]));
break;
- case InstructionSequence::insn_push_literal:
+ case InstructionSequence::insn_push_literal: {
From 50376df951f065a3d462b43a0fd6131eed5c1a0f Mon Sep 17 00:00:00 2001
From: Mitchell Riley <mitchell.v.riley@gmail.com>
Date: Wed, 8 Jul 2009 14:10:34 +1000
Subject: [PATCH] Some fixes for GCC 4.3
---
vm/llvm/inline.cpp | 4 ++--
vm/llvm/inline_primitive.cpp | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)