ruby: fix wrong memory access in catMatch