Fix ref counting bug in BIFs that call internal_type. (fixes #740)

This commit is contained in:
Jon Siwek 2012-01-10 12:25:33 -06:00
parent f921a4d5db
commit 2348d794b6
4 changed files with 17 additions and 7 deletions

View file

@ -129,7 +129,7 @@ function sort_string_array%(a: string_array%): string_array
}
// sort(vs.begin(), vs.end(), Bstr_cmp);
TableVal* b = new TableVal(internal_type("string_array")->AsTableType());
TableVal* b = new TableVal(string_array);
vs_to_string_array(vs, b, 1, n);
return b;
%}
@ -216,7 +216,7 @@ static int match_prefix(int s_len, const char* s, int t_len, const char* t)
Val* do_split(StringVal* str_val, RE_Matcher* re, TableVal* other_sep,
int incl_sep, int max_num_sep)
{
TableVal* a = new TableVal(internal_type("string_array")->AsTableType());
TableVal* a = new TableVal(string_array);
ListVal* other_strings = 0;
if ( other_sep && other_sep->Size() > 0 )
@ -679,7 +679,7 @@ function str_shell_escape%(source: string%): string
# empty set if none).
function find_all%(str: string, re: pattern%) : string_set
%{
TableVal* a = new TableVal(internal_type("string_set")->AsTableType());
TableVal* a = new TableVal(string_set);
const u_char* s = str->Bytes();
const u_char* e = s + str->Len();