Skip to content

Commit

Permalink
escape import module_name and name for report_error
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jun 30, 2024
1 parent 1ef33b3 commit 4621ab5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/instance.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <string.h>

#include "bitmap.h"
#include "escape.h"
#include "exec.h"
#include "instance.h"
#include "mem.h"
Expand Down Expand Up @@ -38,13 +39,19 @@ find_entry_for_import(
}
impobj = impobj->next;
}
struct escaped_string module_name;
struct escaped_string name;
escape_name(&module_name, &im->module_name);
escape_name(&name, &im->name);
if (mismatch) {
report_error(report, "No matching entry for import %.*s:%.*s",
CSTR(&im->module_name), CSTR(&im->name));
ECSTR(&module_name), ECSTR(&name));
} else {
report_error(report, "No entry for import %.*s:%.*s",
CSTR(&im->module_name), CSTR(&im->name));
ECSTR(&module_name), ECSTR(&name));
}
escaped_string_clear(&module_name);
escaped_string_clear(&name);
return ENOENT;
}

Expand Down

0 comments on commit 4621ab5

Please sign in to comment.