patmos: fix of stack cache bug