View Issue Details

IDProjectCategoryView StatusLast Update
0000430LDMud 3.3Runtimepublic2018-01-29 21:57
Reporterfufu Assigned Tolars 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.3.712 
Fixed in Version3.3.713 
Summary0000430: the driver generates too many runtime missing 'return <value>' warnings
DescriptionIn some cases, functions will be compiled with a runtime check for 'falling off' the body; this will cause a warning to be printed every time that happens. As this can happen several thousand times in a single evaluation this has the potential to fill up log files very fast.
Additional InformationTechnically, this is implemented with the F_DEFAULT_RETURN opcode. When it's executed, it prints a warning and then falls through to the F_RETURN0 code.
I'll attach a patch that replaces the F_DEFAULT_RETURN with an F_RETURN0 after the warning has been printed, reducing the number of warnings tremendously. As far as I can see, the instruction is only generated by prolang.y and patching it should be safe. I've tested the patch and it works for me.
TagsNo tags attached.
Attached Files
warn-missing-return-once.diff (476 bytes)   
Index: src/interpret.c
===================================================================
--- src/interpret.c	(revision 2253)
+++ src/interpret.c	(working copy)
@@ -8450,6 +8450,8 @@
          * corrected.
          */
         warnf("Missing 'return <value>' statement.\n");
+        /* Warn only once per missing return and program. */
+        PUT_UINT8(pc-1, F_RETURN0);
         /* FALLTHROUGH */
 
     CASE(F_RETURN0);                /* --- return0             --- */

Activities

lars

2006-03-01 13:01

reporter   ~0000481

Yup, that simply works.

Issue History

Date Modified Username Field Change
2006-01-01 03:27 fufu New Issue
2006-01-01 03:27 fufu File Added: warn-missing-return-once.diff
2006-03-01 13:01 lars Status new => resolved
2006-03-01 13:01 lars Fixed in Version => 3.3.713
2006-03-01 13:01 lars Resolution open => fixed
2006-03-01 13:01 lars Assigned To => lars
2006-03-01 13:01 lars Note Added: 0000481
2007-10-06 19:55 lars Status resolved => closed
2010-11-16 09:42 lars Source_changeset_attached => ldmud.git master 1977ba92
2018-01-29 18:59 lars Source_changeset_attached => ldmud.git master 1977ba92
2018-01-29 21:57 lars Source_changeset_attached => ldmud.git master 1977ba92