summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-13 06:21:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-13 06:21:30 -0700
commitc75ca9d95e8ff7883bd1f193f3723e2a9f76271a (patch)
treec62e27047f0ef060f6017e92bdc829928da65483
parent24775de56ed4eedc53c2e421952a9607eb35cc7e (diff)
downloadtxr-c75ca9d95e8ff7883bd1f193f3723e2a9f76271a.tar.gz
txr-c75ca9d95e8ff7883bd1f193f3723e2a9f76271a.tar.bz2
txr-c75ca9d95e8ff7883bd1f193f3723e2a9f76271a.zip
Broken argument handling in umethod.
* struct.c (umethod_fun): Use proper args interfaces to check whether there is an object argument, and to extract it.
-rw-r--r--struct.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/struct.c b/struct.c
index 1eeb79e6..cdd09dd3 100644
--- a/struct.c
+++ b/struct.c
@@ -932,11 +932,12 @@ static val umethod_fun(val sym, struct args *args)
{
val self = lit("umethod");
- if (args->argc == 0) {
+ if (!args_more(args, 0)) {
uw_throwf(error_s, lit("~a: object argument required to call ~s"),
self, env, nao);
} else {
- val strct = args->arg[0];
+ val strct = args_at(args, 0);
+
struct struct_inst *si = struct_handle(strct, self);
if (symbolp(sym)) {