# HG changeset patch # User Patrick Hurst # Date 1392368403 18000 # Node ID 819756825c8d8f39ea58ab6c52250362be10d2bf # Parent 0ff4f64b4309d76cadc9a34204eb826d5b2fab87# Parent fca98a6cbe23bbd4f9fccd4250cfbc6ef48397d0 Merge in upstream diff -r 0ff4f64b4309 -r 819756825c8d demo/more/orm1.ur --- a/demo/more/orm1.ur Wed Jan 29 18:29:43 2014 -0500 +++ b/demo/more/orm1.ur Fri Feb 14 04:00:03 2014 -0500 @@ -40,7 +40,7 @@ | Some r => {[r.B]}} ) lsS} - + fun main () = return
diff -r 0ff4f64b4309 -r 819756825c8d doc/manual.tex --- a/doc/manual.tex Wed Jan 29 18:29:43 2014 -0500 +++ b/doc/manual.tex Fri Feb 14 04:00:03 2014 -0500 @@ -171,6 +171,7 @@ \item \texttt{linker CMD} sets \texttt{CMD} as the command line prefix to use for linking C object files. The command line will be completed with a space-separated list of \texttt{.o} and \texttt{.a} files, \texttt{-L} and \texttt{-l} flags, and finally with a \texttt{-o} flag to set the location where the executable should be written. \item \texttt{minHeap NUMBYTES} sets the initial size for thread-local heaps used in handling requests. These heaps grow automatically as needed (up to any maximum set with \texttt{limit}), but each regrow requires restarting the request handling process. \item \texttt{monoInline TREESIZE} sets how many nodes the AST of a function definition may have before the optimizer stops trying hard to inline calls to that function. (This is one of two options for one of two intermediate languages within the compiler.) +\item \texttt{neverInline PATH} requests that no call to the referenced function be inlined. Section \ref{structure} explains how functions are assigned path strings. \item \texttt{noMangleSql} avoids adding a \texttt{uw\_} prefix in front of each identifier in SQL. With this experimental feature, the burden is on the programmer to avoid naming tables or columns after SQL keywords! \item \texttt{noXsrfProtection URIPREFIX} turns off automatic cross-site request forgery protection for the page handler identified by the given URI prefix. This will avoid checking cryptographic signatures on cookies, which is generally a reasonable idea for some pages, such as login pages that are going to discard all old cookie values, anyway. \item \texttt{onError Module.var} changes the handling of fatal application errors. Instead of displaying a default, ugly error 500 page, the error page will be generated by calling function \texttt{Module.var} on a piece of XML representing the error message. The error handler should have type $\mt{xbody} \to \mt{transaction} \; \mt{page}$. Note that the error handler \emph{cannot} be in the application's main module, since that would register it as explicitly callable via URLs. diff -r 0ff4f64b4309 -r 819756825c8d src/c/Makefile.am --- a/src/c/Makefile.am Wed Jan 29 18:29:43 2014 -0500 +++ b/src/c/Makefile.am Fri Feb 14 04:00:03 2014 -0500 @@ -7,7 +7,7 @@ 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 -r 0ff4f64b4309 -r 819756825c8d src/c/urweb.c --- a/src/c/urweb.c Wed Jan 29 18:29:43 2014 -0500 +++ b/src/c/urweb.c Fri Feb 14 04:00:03 2014 -0500 @@ -3933,7 +3933,7 @@ 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 -r 0ff4f64b4309 -r 819756825c8d src/compiler.sml --- a/src/compiler.sml Wed Jan 29 18:29:43 2014 -0500 +++ b/src/compiler.sml Fri Feb 14 04:00:03 2014 -0500 @@ -869,6 +869,7 @@ 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 -r 0ff4f64b4309 -r 819756825c8d src/mono_reduce.sml --- a/src/mono_reduce.sml Wed Jan 29 18:29:43 2014 -0500 +++ b/src/mono_reduce.sml Fri Feb 14 04:00:03 2014 -0500 @@ -395,10 +395,11 @@ 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 -r 0ff4f64b4309 -r 819756825c8d src/settings.sig --- a/src/settings.sig Wed Jan 29 18:29:43 2014 -0500 +++ b/src/settings.sig Fri Feb 14 04:00:03 2014 -0500 @@ -252,6 +252,9 @@ 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 -r 0ff4f64b4309 -r 819756825c8d src/settings.sml --- a/src/settings.sml Wed Jan 29 18:29:43 2014 -0500 +++ b/src/settings.sml Fri Feb 14 04:00:03 2014 -0500 @@ -688,6 +688,10 @@ 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)