aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/csource.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/csource/csource.go')
-rw-r--r--pkg/csource/csource.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go
index 32e01ff1e..6dd8bdcd6 100644
--- a/pkg/csource/csource.go
+++ b/pkg/csource/csource.go
@@ -253,6 +253,14 @@ func (ctx *context) generateCalls(p prog.ExecProg, trace bool) ([]string, []uint
ctx.emitCall(w, call, ci, resCopyout || argCopyout, trace)
+ if call.Props.Rerun > 0 {
+ // TODO: remove this legacy C89-style definition once we figure out what to do with Akaros.
+ fmt.Fprintf(w, "\t{\n\tint i;\n")
+ fmt.Fprintf(w, "\tfor(i = 0; i < %v; i++) {\n", call.Props.Rerun)
+ // Rerun invocations should not affect the result value.
+ ctx.emitCall(w, call, ci, false, false)
+ fmt.Fprintf(w, "\t\t}\n\t}\n")
+ }
// Copyout.
if resCopyout || argCopyout {
ctx.copyout(w, call, resCopyout)