X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=dll%2Fwin32%2Fvbscript%2Fcompile.c;h=302804f4c28cdd811e8b4ce1a7ececb61ca9ef6e;hp=d61c6491e85cf053df82545b8806adc6d164df6c;hb=bcea8c65d05c0a699765fc8c0a8be42f1cb394e5;hpb=8db8073cbb2ceddf2cd8ffa6fbe0893c95941034 diff --git a/dll/win32/vbscript/compile.c b/dll/win32/vbscript/compile.c index d61c6491e85..302804f4c28 100644 --- a/dll/win32/vbscript/compile.c +++ b/dll/win32/vbscript/compile.c @@ -16,8 +16,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include "vbscript.h" +#include "parse.h" +#include "parser.tab.h" + +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(vbscript); WINE_DECLARE_DEBUG_CHANNEL(vbscript_disas); typedef struct _statement_ctx_t { @@ -515,6 +522,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_nequal); case EXPR_NEW: return push_instr_str(ctx, OP_new, ((string_expression_t*)expr)->value); + case EXPR_NOARG: + return push_instr_int(ctx, OP_hres, DISP_E_PARAMNOTFOUND); case EXPR_NOT: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_not); case EXPR_NOTHING: @@ -1649,11 +1658,10 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl) return E_OUTOFMEMORY; class_desc->props[i].is_public = prop_decl->is_public; + class_desc->props[i].is_array = prop_decl->is_array; - if(prop_decl->is_array) { - class_desc->props[i].is_array = TRUE; + if(prop_decl->is_array) class_desc->array_cnt++; - } } if(class_desc->array_cnt) { @@ -1738,6 +1746,8 @@ void release_vbscode(vbscode_t *code) for(i=0; i < code->bstr_cnt; i++) SysFreeString(code->bstr_pool[i]); + if(code->context) + IDispatch_Release(code->context); heap_pool_free(&code->heap); heap_free(code->bstr_pool); @@ -1750,7 +1760,7 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source) { vbscode_t *ret; - ret = heap_alloc(sizeof(*ret)); + ret = heap_alloc_zero(sizeof(*ret)); if(!ret) return NULL; @@ -1772,19 +1782,8 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source) ret->option_explicit = ctx->parser.option_explicit; - ret->bstr_pool = NULL; - ret->bstr_pool_size = 0; - ret->bstr_cnt = 0; - ret->pending_exec = FALSE; - ret->main_code.type = FUNC_GLOBAL; - ret->main_code.name = NULL; ret->main_code.code_ctx = ret; - ret->main_code.vars = NULL; - ret->main_code.var_cnt = 0; - ret->main_code.array_cnt = 0; - ret->main_code.arg_cnt = 0; - ret->main_code.args = NULL; list_init(&ret->entry); return ret;