78853: Subject: [PATCH 6/21 try2] vbscript: Added function arguments compiler implementation

buildbot at kegel.com buildbot at kegel.com
Wed Sep 14 09:02:14 CDT 2011


This is an experimental automated build and test service.
Please feel free to ignore this email while we work the kinks out.

For more info about this message, see http://wiki.winehq.org/BuildBot

The Buildbot has detected a failed build on builder runtests-default while building Wine.
Full details are available at: http://buildbot.kegel.com/builders/runtests-default/builds/46 (though maybe not for long, as I'm still reinstalling the buildbot periodically while experimenting)
BUILD FAILED: failed git

Errors:
error: patch failed: dlls/vbscript/compile.c:658
error: dlls/vbscript/compile.c: patch does not apply
error: patch failed: dlls/vbscript/vbscript.h:152
error: dlls/vbscript/vbscript.h: patch does not apply

-------------- next part --------------
From: Jacek Caban <jacek at codeweavers.com>
Subject: [PATCH 6/21 try2] vbscript: Added function arguments compiler implementation
Message-Id: <4E70964D.4050000 at codeweavers.com>
Date: Wed, 14 Sep 2011 13:55:57 +0200

try2: With fix spotted by Octavian. I'm not resending the whole series 
as testbot is useless for it anyway.

---
  dlls/vbscript/compile.c  |   23 +++++++++++++++++++++--
  dlls/vbscript/vbscript.h |    7 +++++++
  2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c
index 651bf7c..386caf7 100644
--- a/dlls/vbscript/compile.c
+++ b/dlls/vbscript/compile.c
@@ -658,9 +658,26 @@ static HRESULT create_function(compile_ctx_t *ctx, function_decl_t *decl, functi
     func->code_ctx = ctx->code;
     func->type = decl->type;
 
+    func->arg_cnt = 0;
     if(decl->args) {
-        FIXME("arguments not implemented\n");
-        return E_NOTIMPL;
+        arg_decl_t *arg;
+        unsigned i;
+
+        for(arg = decl->args; arg; arg = arg->next)
+            func->arg_cnt++;
+
+        func->args = compiler_alloc(ctx->code, func->arg_cnt * sizeof(arg_desc_t));
+        if(!func->args)
+            return E_OUTOFMEMORY;
+
+        for(i = 0, arg = decl->args; arg; arg = arg->next, i++) {
+            func->args[i].name = compiler_alloc_string(ctx->code, arg->name);
+            if(!func->args[i].name)
+                return E_OUTOFMEMORY;
+            func->args[i].by_ref = arg->by_ref;
+        }
+    }else {
+        func->args = NULL;
     }
 
     hres = compile_func(ctx, decl->body, func);
@@ -761,6 +778,8 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
     ret->global_code.type = FUNC_GLOBAL;
     ret->global_code.name = NULL;
     ret->global_code.code_ctx = ret;
+    ret->global_code.arg_cnt = 0;
+    ret->global_code.args = NULL;
 
     list_init(&ret->entry);
     return ret;
diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
index d541e9d..0e6d57e 100644
--- a/dlls/vbscript/vbscript.h
+++ b/dlls/vbscript/vbscript.h
@@ -152,6 +152,11 @@ typedef struct {
     instr_arg_t arg2;
 } instr_t;
 
+typedef struct {
+    const WCHAR *name;
+    BOOL by_ref;
+} arg_desc_t;
+
 typedef enum {
     FUNC_GLOBAL,
     FUNC_SUB
@@ -160,6 +165,8 @@ typedef enum {
 struct _function_t {
     function_type_t type;
     const WCHAR *name;
+    arg_desc_t *args;
+    unsigned arg_cnt;
     unsigned code_off;
     vbscode_t *code_ctx;
     function_t *next;



More information about the wine-tests-results mailing list