]> Nishi Git Mirror - gwion.git/commitdiff
:art: Ptr coverage
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 8 Oct 2019 12:56:53 +0000 (14:56 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 8 Oct 2019 12:56:53 +0000 (14:56 +0200)
src/lib/ptr.c
tests/error/empty_ptr.gw [new file with mode: 0644]

index f6629c16662d8aa27658d15d35c7848b10342bc1..59a0d4771c3f7b10a467c67374d29c365b32d21b 100644 (file)
@@ -76,7 +76,7 @@ static OP_CHECK(opck_implicit_ptr) {
 static INSTR(instr_ptr_deref) {
   const M_Object o = *(M_Object*)REG(-SZ_INT);
   if(!*(m_bit**)o->data)
-    Except(shred, _("EmptyPointerExecption"));
+    Except(shred, _("EmptyPointerException"));
   if(instr->m_val2)
     memcpy(REG(-SZ_INT), o->data, SZ_INT);
   else {
diff --git a/tests/error/empty_ptr.gw b/tests/error/empty_ptr.gw
new file mode 100644 (file)
index 0000000..052bbb2
--- /dev/null
@@ -0,0 +1,3 @@
+#! [contains] EmptyPointerException
+<~int~>Ptr t;
+<<< *t >>>;