about summary refs log tree commit diff
path: root/src/aterm-helper.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/aterm-helper.pl')
-rwxr-xr-xsrc/aterm-helper.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/aterm-helper.pl b/src/aterm-helper.pl
index 376691c9a210..5067b0a9be8d 100755
--- a/src/aterm-helper.pl
+++ b/src/aterm-helper.pl
@@ -56,6 +56,7 @@ while (<STDIN>) {
         my $unpack = "";
         my $n = 1;
         foreach my $type (@types) {
+            my $realType = $type;
             $args .= ", ";
             if ($type eq "string") {
 #                $args .= "(ATerm) ATmakeAppl0(ATmakeAFun((char *) e$n, 0, ATtrue))";
@@ -83,6 +84,9 @@ while (<STDIN>) {
                 $unpack .= "    e$n = (ATermList) ATgetArgument(e, $m);\n";
             } elsif ($type eq "ATermBlob") {
                 $unpack .= "    e$n = (ATermBlob) ATgetArgument(e, $m);\n";
+            } elsif ($realType eq "string") {
+                $unpack .= "    e$n = ATgetArgument(e, $m);\n";
+                $unpack .= "    if (ATgetType(e$n) != AT_APPL) return false;\n";
             } else {
                 $unpack .= "    e$n = ATgetArgument(e, $m);\n";
             }