summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-10-14 20:01:15 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2015-10-14 20:01:15 (GMT)
commitc260593486213c84521b23b40759800e4a312db9 (patch)
treeec36120a31ace1ed5f4062f25aabaeaf74046bc1
parent69f043998a0635b754c6828608f7a2e2f8430307 (diff)
downloadnsgenbind-c260593486213c84521b23b40759800e4a312db9.tar.gz
nsgenbind-c260593486213c84521b23b40759800e4a312db9.tar.bz2
Fix putforwards generation to cope with getters leaving a dirty stack
Kinnison did all teh heavy tjinking on this!
-rw-r--r--src/duk-libdom-interface.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/duk-libdom-interface.c b/src/duk-libdom-interface.c
index 66834b3..a52d25b 100644
--- a/src/duk-libdom-interface.c
+++ b/src/duk-libdom-interface.c
@@ -1394,17 +1394,16 @@ output_putforwards_setter(FILE* outf,
"\tif (get_ret != 1) {\n"
"\t\treturn 0;\n"
"\t}\n\n"
- "\t/* parameter attribute */\n\n"
- "\tduk_swap(ctx, 0, 1);\n"
- "\t/* attribute parameter */\n\n"
+ "\t/* parameter ... attribute */\n\n"
+ "\tduk_dup(ctx, 0);\n"
+ "\t/* ... attribute parameter */\n\n"
"\t/* call the putforward */\n");
fprintf(outf,
- "\tduk_put_prop_string(ctx, 0, \"%s\");\n\n",
+ "\tduk_put_prop_string(ctx, -2, \"%s\");\n\n",
atributee->putforwards);
fprintf(outf,
- "\tduk_pop(ctx);\n\n"
"\treturn 0;\n");
return 0;