Permalink
Browse files

[NCI] ensure that nci_info members are CONSTANT STRINGS

git-svn-id: https://svn.parrot.org/parrot/trunk@32203 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent 7c0cf6a commit 33d35c5bffbe6a557f07be959f0cffd8c532988b @tewk tewk committed Oct 27, 2008
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/pmc/nci.pmc
View
@@ -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);
@@ -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). */

0 comments on commit 33d35c5

Please sign in to comment.