Module: wine Branch: oldstable Commit: 3f5ca5b5b163a752e65454cefc980629f15d07e8 URL: https://source.winehq.org/git/wine.git/?a=commit;h=3f5ca5b5b163a752e65454cef...
Author: Robert Wilhelm robert.wilhelm@gmx.net Date: Tue Oct 13 18:58:06 2020 +0200
vbscript: Add is_default flag to function_decl_t.
Signed-off-by: Robert Wilhelm robert.wilhelm@gmx.net Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit 54740a5cb8dfb8ccedad988aaf46125893cebd15) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/vbscript/compile.c | 6 ++---- dlls/vbscript/interp.c | 2 +- dlls/vbscript/parse.h | 1 + dlls/vbscript/parser.y | 4 +++- dlls/vbscript/vbdisp.c | 2 +- dlls/vbscript/vbscript.h | 1 - 6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index c76ba73bd8c..fc0b22c65c8 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -1444,7 +1444,6 @@ static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *f case FUNC_PROPGET: case FUNC_PROPLET: case FUNC_PROPSET: - case FUNC_DEFGET: ctx->prop_end_label = alloc_label(ctx); if(!ctx->prop_end_label) return E_OUTOFMEMORY; @@ -1606,7 +1605,6 @@ static HRESULT create_class_funcprop(compile_ctx_t *ctx, function_decl_t *func_d case FUNC_FUNCTION: case FUNC_SUB: case FUNC_PROPGET: - case FUNC_DEFGET: invoke_type = VBDISP_CALLGET; break; case FUNC_PROPLET: @@ -1672,7 +1670,7 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl)
for(func_decl = class_decl->funcs; func_decl; func_decl = func_decl->next) { for(func_prop_decl = func_decl; func_prop_decl; func_prop_decl = func_prop_decl->next_prop_func) { - if(func_prop_decl->type == FUNC_DEFGET) + if(func_prop_decl->is_default) break; } if(!func_prop_decl) @@ -1686,7 +1684,7 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl)
for(func_decl = class_decl->funcs, i=1; func_decl; func_decl = func_decl->next, i++) { for(func_prop_decl = func_decl; func_prop_decl; func_prop_decl = func_prop_decl->next_prop_func) { - if(func_prop_decl->type == FUNC_DEFGET) { + if(func_prop_decl->is_default) { i--; break; } diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 66ad2068375..a3d37d23dd5 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -119,7 +119,7 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ DISPID id; HRESULT hres;
- if((ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET || ctx->func->type == FUNC_DEFGET) + if((ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET) && !wcsicmp(name, ctx->func->name)) { ref->type = REF_VAR; ref->u.v = &ctx->ret_val; diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index 4bf82cbedb3..a9875f2efec 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -183,6 +183,7 @@ typedef struct _function_decl_t { const WCHAR *name; function_type_t type; BOOL is_public; + BOOL is_default; arg_decl_t *args; statement_t *body; struct _function_decl_t *next; diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 9507e97e8ca..4a4708e7785 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -992,10 +992,11 @@ static function_decl_t *new_function_decl(parser_ctx_t *ctx, const WCHAR *name, unsigned storage_flags, arg_decl_t *arg_decl, statement_t *body) { function_decl_t *decl; + BOOL is_default = FALSE;
if(storage_flags & STORAGE_IS_DEFAULT) { if(type == FUNC_PROPGET) { - type = FUNC_DEFGET; + is_default = TRUE; }else { FIXME("Invalid default property\n"); ctx->hres = E_FAIL; @@ -1010,6 +1011,7 @@ static function_decl_t *new_function_decl(parser_ctx_t *ctx, const WCHAR *name, decl->name = name; decl->type = type; decl->is_public = !(storage_flags & STORAGE_IS_PRIVATE); + decl->is_default = is_default; decl->args = arg_decl; decl->body = body; decl->next = NULL; diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c index c14cd7b4c71..7db333660d7 100644 --- a/dlls/vbscript/vbdisp.c +++ b/dlls/vbscript/vbdisp.c @@ -177,7 +177,7 @@ static HRESULT invoke_vbdisp(vbdisp_t *This, DISPID id, DWORD flags, BOOL extern switch(flags) { case DISPATCH_PROPERTYGET: func = This->desc->funcs[id].entries[VBDISP_CALLGET]; - if(!func || (func->type != FUNC_PROPGET && func->type != FUNC_DEFGET)) { + if(!func || func->type != FUNC_PROPGET) { WARN("no getter\n"); return DISP_E_MEMBERNOTFOUND; } diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 19431e23c34..9b2d28050e2 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -310,7 +310,6 @@ typedef enum { FUNC_PROPGET, FUNC_PROPLET, FUNC_PROPSET, - FUNC_DEFGET } function_type_t;
typedef struct {