[stupid-crypto] push by ben@links.org - Fix struct-returns. on 2010-03-29 04:33 GMT

0 views
Skip to first unread message

stupid...@googlecode.com

unread,
Mar 29, 2010, 12:33:20 AM3/29/10
to stupi...@googlegroups.com
Revision: 2f6df46b50
Author: Ben Laurie <b...@links.org>
Date: Sun Mar 28 21:32:57 2010
Log: Fix struct-returns.
http://code.google.com/p/stupid-crypto/source/detail?r=2f6df46b50

Modified:
/src/Stupid/C.pm

=======================================
--- /src/Stupid/C.pm Sun Mar 21 10:29:19 2010
+++ /src/Stupid/C.pm Sun Mar 28 21:32:57 2010
@@ -257,6 +257,16 @@
my $init = shift;

$self->{type}->emitDeclaration($self->{name});
+
+ # special case ... clearly we could do this in full generality,
+ # e.g f()[8] or f().foo or (a, b) = (c, d) or (a, b) = (b, a)
+ # [hmmm]
+ if(ref($init) eq 'Stupid::FunctionCall') {
+ print ";\n";
+ $init->emitCallWithLValue($self);
+ return;
+ }
+
print ' = ';
$init->emitCode();
}

Reply all
Reply to author
Forward
0 new messages