projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
fix leak
[m6w6/ext-psi]
/
src
/
types
/
const.c
diff --git
a/src/types/const.c
b/src/types/const.c
index a40a0e2b0eb35a86e07b5fafae391c299acbb7aa..449f04a1221e493e366d392825f7fb47d7eea477 100644
(file)
--- a/
src/types/const.c
+++ b/
src/types/const.c
@@
-31,7
+31,7
@@
struct psi_const *psi_const_init(struct psi_const_type *type, const char *name,
{
struct psi_const *c = calloc(1, sizeof(*c));
c->type = type;
{
struct psi_const *c = calloc(1, sizeof(*c));
c->type = type;
- c->name = strdup(name);
+ c->name = strdup(name
[0] == '\\' ? &name[1] : name
);
c->val = val;
return c;
}
c->val = val;
return c;
}
@@
-63,6
+63,8
@@
void psi_const_dump(int fd, struct psi_const *cnst)
bool psi_const_validate(struct psi_data *data, struct psi_const *c)
{
bool psi_const_validate(struct psi_data *data, struct psi_const *c)
{
- /* FIXME */
+ if (!psi_impl_def_val_validate(data, c->val, c->type->type, c->type->name)) {
+ return false;
+ }
return true;
}
return true;
}