Skip to content

Instantly share code, notes, and snippets.

(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/daniel/Dev/rbx-llvm/bin/rbx
[Thread debugging using libthread_db enabled]
[New Thread 0x7f3468a41700 (LWP 28200)]
[Switching to Thread 0x7f3468a41700 (LWP 28200)]
Breakpoint 2, VMMethod (this=0x1e1e810, state=0x1de9580, meth=0x7f346720a518)
$ bin/rbx -Xjit.enabled -e ''
exception detected at toplevel: (StackError)
kernel/alpha.rb:20
kernel/delta/kernel.rb:47
kernel/bootstrap/kernel.rb:43
kernel/delta/kernel.rb:18
kernel/delta/kernel.rb:47
kernel/bootstrap/kernel.rb:43
kernel/delta/kernel.rb:18
kernel/delta/kernel.rb:47
diff --git i/vm/llvm/jit_operations.hpp w/vm/llvm/jit_operations.hpp
index f55a771..aa15021 100644
--- i/vm/llvm/jit_operations.hpp
+++ w/vm/llvm/jit_operations.hpp
@@ -293,7 +293,7 @@ namespace rubinius {
Value* ptrtoint(Value* ptr) {
return CastInst::Create(
Instruction::PtrToInt,
- ptr, Type::Int32Ty, "ptr2int", block_);
+ ptr, IntPtrTy, "ptr2int", block_);
@mernen
mernen / tactics.js
Created July 26, 2010 03:52
Nerdson Labs: algoritmo de movimento estilo jogo TBS
$(document).ready(function(){
$("#tactics form").submit(function(e){
e.preventDefault();
});
//syntax highlight
ChiliBook.recipeFolder = "./";
//observação: criei variáveis globais aqui a nivel de exemplo, mas isso não é recomendado. O ideal é criar objetos para armazenar esses valores. ;)
# let's define this (bash) function to help us see what's happening:
args() { echo "${#@} arguments:"; for arg in "$@"; do echo "-> $arg"; done; }
# now let's see the differences between $@ and $*:
# $*: expands into a series of words, basically ignoring all the quotes
# you'll hardly ever want to do this
test() { args $*; }
test a "b b" c
@mernen
mernen / octocat.png
Last active December 16, 2015 07:48
git diff octocat.png This was an attempt to use GitHub's image diff to show what changed on their new Octocat. Unfortunately, it doesn't work on Gists :(
octocat.png
@mernen
mernen / fizzbuzz.rb
Last active March 28, 2021 13:42
FizzBuzz as a Regexp - source for http://pastie.org/158799
#! /usr/bin/env ruby1.9
puts 1.upto(100).to_a.join("\n").
gsub(%r{
(?# matchers for multiples of 3 -- remainder=0,1,2 respectively)
(?<z>[0369]+(?:\g<u>\g<d>|\g<d>\g<u>)?|\g<u>\g<d>|\g<d>\g<u>){0}
(?<u>[147]\g<z>?|[258][0369]*\g<d>){0}
(?<d>[258]\g<z>?|[147][0369]*\g<u>){0}
(?# fizz/buzz matchers)
(?<fizz>\g<z>){0}
@mernen
mernen / test_regexp.js
Last active December 20, 2015 01:39
Sample testcase for PhantomJS issue #11494
var re1 = /test/;
var re2 = new RegExp(re1);
assert(re1 !== re2, "new RegExp() should always return a new object");
var scanner = /foo/g;
scanner.lastIndex = 3;
var copy = new RegExp(scanner);
assert(copy.lastIndex === 0, "new RegExp(...) should never copy lastIndex");
#!/bin/sh
set -ex
mkdir -p /tmp/repro-6074
cd /tmp/repro-6074
bundle env
# Bundler 1.15.4
# Rubygems 2.6.13
# Ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]