Skip to content

Commit

Permalink
Merge pull request #78 from namhyung/misc-fix
Browse files Browse the repository at this point in the history
Small touch-up of the error message.
  • Loading branch information
wkz committed Nov 25, 2021
2 parents a07e3dd + 88357ae commit 3f205bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/libply/built-in/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,12 @@ static int map_type_infer(const struct func *func, struct node *n)
return 0;

if (map->sym->type) {
if (map->sym->type->ttype != T_MAP) {
_ne(n, "can't lookup a key in %N (type '%T'), "
"which is not a map.\n", map, map->sym->type);
return -EINVAL;
}

if (!n->sym->type)
/* given `m[key]` where m's type is known,
* infer that the expression's type is equal
Expand Down
2 changes: 1 addition & 1 deletion src/libply/provider/special.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int register_special_probes(special_probe_t begin, special_probe_t end)
{
FILE *fp;
char buf[PATH_MAX];
unsigned long base_addr;
unsigned long base_addr = 0;

if (begin == NULL && end == NULL)
return 0;
Expand Down

0 comments on commit 3f205bf

Please sign in to comment.