]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/alien.cpp
Put brackets around ipv6 addresses in `inet6 present`
[factor.git] / vm / alien.cpp
index bd6aa9077a43bd960372e681d20f1e39116be241..8b6cc81b765b00773931de952ad205479be4087b 100644 (file)
@@ -5,15 +5,14 @@ namespace factor {
 // gets the address of an object representing a C pointer, with the
 // intention of storing the pointer across code which may potentially GC.
 char* factor_vm::pinned_alien_offset(cell obj) {
-  switch (tagged<object>(obj).type()) {
+  switch (TAG(obj)) {
     case ALIEN_TYPE: {
       alien* ptr = untag<alien>(obj);
       if (to_boolean(ptr->expired))
         general_error(ERROR_EXPIRED, obj, false_object);
       if (to_boolean(ptr->base))
         type_error(ALIEN_TYPE, obj);
-      else
-        return (char*)ptr->address;
+      return (char*)ptr->address;
     }
     case F_TYPE:
       return NULL;
@@ -57,7 +56,7 @@ void factor_vm::primitive_displaced_alien() {
   cell alien = ctx->pop();
   cell displacement = to_cell(ctx->pop());
 
-  switch (tagged<object>(alien).type()) {
+  switch (TAG(alien)) {
     case BYTE_ARRAY_TYPE:
     case ALIEN_TYPE:
     case F_TYPE:
@@ -163,7 +162,7 @@ void factor_vm::primitive_dll_validp() {
 
 // gets the address of an object representing a C pointer
 char* factor_vm::alien_offset(cell obj) {
-  switch (tagged<object>(obj).type()) {
+  switch (TAG(obj)) {
     case BYTE_ARRAY_TYPE:
       return untag<byte_array>(obj)->data<char>();
     case ALIEN_TYPE: