diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/c/Makefile.am | 2 | ||||
-rw-r--r-- | src/c/urweb.c | 2 | ||||
-rw-r--r-- | src/compiler.sml | 1 | ||||
-rw-r--r-- | src/mono_reduce.sml | 9 | ||||
-rw-r--r-- | src/settings.sig | 3 | ||||
-rw-r--r-- | src/settings.sml | 4 |
6 files changed, 15 insertions, 6 deletions
diff --git a/src/c/Makefile.am b/src/c/Makefile.am index 8ed374f6..d117d018 100644 --- a/src/c/Makefile.am +++ b/src/c/Makefile.am @@ -7,7 +7,7 @@ liburweb_fastcgi_la_SOURCES = fastcgi.c fastcgi.h liburweb_static_la_SOURCES = static.c AM_CPPFLAGS = -I$(srcdir)/../../include/urweb $(OPENSSL_INCLUDES) -AM_CFLAGS = -Wimplicit -Wall -Werror -Wno-format-security -Wno-deprecated-declarations $(PTHREAD_CFLAGS) +AM_CFLAGS = -Wimplicit -Wall -Werror -Wno-format-security -Wno-deprecated-declarations -U_FORTIFY_SOURCE $(PTHREAD_CFLAGS) liburweb_la_LDFLAGS = $(AM_LDFLAGS) $(OPENSSL_LDFLAGS) liburweb_la_LIBADD = $(PTHREAD_LIBS) -lm $(OPENSSL_LIBS) liburweb_http_la_LIBADD = liburweb.la diff --git a/src/c/urweb.c b/src/c/urweb.c index 4eb542df..7ff8a262 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -3933,7 +3933,7 @@ uw_Basis_int uw_Basis_toSeconds(uw_context ctx, uw_Basis_time tm) { uw_Basis_time uw_Basis_fromDatetime(uw_context ctx, uw_Basis_int year, uw_Basis_int month, uw_Basis_int day, uw_Basis_int hour, uw_Basis_int minute, uw_Basis_int second) { struct tm tm = { .tm_year = year - 1900, .tm_mon = month, .tm_mday = day, .tm_hour = hour, .tm_min = minute, .tm_sec = second }; - uw_Basis_time r = { timegm(&tm) }; + uw_Basis_time r = { timelocal(&tm) }; return r; } diff --git a/src/compiler.sml b/src/compiler.sml index 21ae903f..cc4e33c5 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -869,6 +869,7 @@ fun parseUrp' accLibs fname = NONE => ErrorMsg.error ("invalid mono inline level '" ^ arg ^ "'") | SOME n => Settings.setMonoInline n) | "alwaysInline" => Settings.addAlwaysInline arg + | "neverInline" => Settings.addNeverInline arg | "noXsrfProtection" => Settings.addNoXsrfProtection arg | "timeFormat" => Settings.setTimeFormat arg | "noMangleSql" => Settings.setMangleSql false diff --git a/src/mono_reduce.sml b/src/mono_reduce.sml index 846a878b..c92ce5aa 100644 --- a/src/mono_reduce.sml +++ b/src/mono_reduce.sml @@ -395,10 +395,11 @@ fun reduce (file : file) = fun mayInline (n, e, t, s) = case IM.find (uses, n) of NONE => false - | SOME count => count <= 1 - orelse size e <= Settings.getMonoInline () - orelse functionInside t - orelse Settings.checkAlwaysInline s + | SOME count => not (Settings.checkNeverInline s) + andalso (count <= 1 + orelse size e <= Settings.getMonoInline () + orelse functionInside t + orelse Settings.checkAlwaysInline s) fun summarize d (e, _) = let diff --git a/src/settings.sig b/src/settings.sig index a7a41447..20dd00c2 100644 --- a/src/settings.sig +++ b/src/settings.sig @@ -252,6 +252,9 @@ signature SETTINGS = sig val addAlwaysInline : string -> unit val checkAlwaysInline : string -> bool + val addNeverInline : string -> unit + val checkNeverInline : string -> bool + val addNoXsrfProtection : string -> unit val checkNoXsrfProtection : string -> bool diff --git a/src/settings.sml b/src/settings.sml index 93f54427..020ca5a4 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -688,6 +688,10 @@ val alwaysInline = ref SS.empty fun addAlwaysInline s = alwaysInline := SS.add (!alwaysInline, s) fun checkAlwaysInline s = SS.member (!alwaysInline, s) +val neverInline = ref SS.empty +fun addNeverInline s = neverInline := SS.add (!neverInline, s) +fun checkNeverInline s = SS.member (!neverInline, s) + val noXsrfProtection = ref SS.empty fun addNoXsrfProtection s = noXsrfProtection := SS.add (!noXsrfProtection, s) fun checkNoXsrfProtection s = SS.member (!noXsrfProtection, s) |