Skip to content

Commit

Permalink
[NCI] ensure that nci_info members are CONSTANT STRINGS
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@32203 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
tewk committed Oct 27, 2008
1 parent 7c0cf6a commit 33d35c5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pmc/nci.pmc
Expand Up @@ -79,7 +79,8 @@ void pcc_params(PARROT_INTERP, STRING *sig, Parrot_NCI_attributes * const nci_in
}
PARROT_ASSERT(j <= sig_length);

params = string_make(interp, param_sig, j, "ascii", 0);
params = string_make(interp, param_sig, strlen(param_sig), NULL, PObj_constant_FLAG);

nci_info->pcc_params_signature = params;

mem_sys_free(param_sig);
Expand Down Expand Up @@ -162,10 +163,13 @@ Sets the specified function pointer and signature (C<*key>).
VTABLE void set_pointer_keyed_str(STRING *key, void *func) {
Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
int jitted = 0;
char *key_c;

/* Store the original function and signature. */
PMC_struct_val(SELF) = func;
nci_info->signature = key;
key_c = string_to_cstring(INTERP, key);
nci_info->signature = string_make(interp, key_c, strlen(key_c), NULL, PObj_constant_FLAG);
string_cstring_free(key_c);
pcc_params(INTERP, key, nci_info);

/* Arity is length of that string minus one (the return type). */
Expand Down

0 comments on commit 33d35c5

Please sign in to comment.