--- parser3/src/classes/op.C 2003/02/20 16:09:00 1.127.2.14 +++ parser3/src/classes/op.C 2003/02/21 08:50:01 1.127.2.16 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_OP_C="$Date: 2003/02/20 16:09:00 $"; +static const char* IDENT_OP_C="$Date: 2003/02/21 08:50:01 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -145,6 +145,7 @@ static void _taint(Request& r, StringPtr static void _process(Request& r, StringPtr method_name, MethodParams* params) { Pool& pool=r.pool(); + StringPtr source; // must be declared here to prevent premature destruction MethodPtr main_method; ValuePtr target_self=params->count()>1? params->as_no_junction(0, "target must not be code") @@ -159,7 +160,7 @@ static void _process(Request& r, StringP "no target class"); // evaluate source to process - StringPtr source=r.process_to_string(vjunction); + source=r.process_to_string(vjunction); // temporary remove language change Temp_lang temp_lang(r, String::UL_PASS_APPENDED); @@ -191,7 +192,7 @@ static void _process(Request& r, StringP // process source code, append processed methods to 'self' class // maybe-define new @main r.use_buf(*target_class, - source->cstr(String::UL_UNSPECIFIED, r.connection(StringPtr(0))), + source->cstr(pool, String::UL_UNSPECIFIED, r.connection(StringPtr(0))), StringPtr(new String(heap_place, place_size, true /*tainted*/)), heap_place); @@ -685,17 +686,17 @@ static void _throw_operator(Request& r, if(HashStringValue *hash=param0->get_hash(method_name)) { const char* type=0; if(ValuePtr value=hash->get(exception_type_part_name)) - type=value->as_string(&pool)->cstr(); - StringPtr source(0); + type=value->as_string(&pool)->cstr(pool); + StringPtr source; if(ValuePtr value=hash->get(exception_source_part_name)) source=value->as_string(&pool); - CharPtr comment(0); + CharPtr comment; if(ValuePtr value=hash->get(exception_comment_part_name)) comment=value->as_string(&pool)->cstr(); throw Exception(type, source?source:method_name, - comment); + "%s", comment?comment:""); } else throw Exception("parser.runtime", method_name,