From 250b4bb960be18b107cdfd02fd298c3235f66b4b Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Tue, 26 Feb 2019 09:15:19 -0600 Subject: [PATCH 1/2] Circumvent more illegal instructions --- Project.toml | 1 + src/JuliaInterpreter.jl | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Project.toml b/Project.toml index 5261a234..c9ed6d01 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,7 @@ version = "0.1.1" [deps] InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [extras] diff --git a/src/JuliaInterpreter.jl b/src/JuliaInterpreter.jl index 11a03ace..32c06108 100644 --- a/src/JuliaInterpreter.jl +++ b/src/JuliaInterpreter.jl @@ -6,6 +6,10 @@ using Core: CodeInfo, SSAValue, SlotNumber, TypeMapEntry, SimpleVector, LineInfo GeneratedFunctionStub, MethodInstance, NewvarNode, TypeName using UUIDs +# The following are for circumventing #28, memcpy invalid instruction error, +# in Base and stdlib +using Random.DSFMT +using InteractiveUtils export @enter, @make_stack, @interpret, Compiled, JuliaStackFrame @@ -1060,6 +1064,11 @@ function set_compiled_methods() push!(compiled_methods, which(vcat, (Vector,))) push!(compiled_methods, first(methods(Base._getindex_ra))) push!(compiled_methods, first(methods(Base._setindex_ra!))) + push!(compiled_methods, which(Base.decompose, (BigFloat,))) + push!(compiled_methods, @eval DSFMT which(dsfmt_jump, (DSFMT_state, GF2X))) + if Sys.iswindows() + push!(compiled_methods, which(InteractiveUtils.clipboard, (AbstractString,))) + end end function __init__() From 3ab46397638c837fa9aa2b07b110784083fea109 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Tue, 26 Feb 2019 09:15:44 -0600 Subject: [PATCH 2/2] Allow juliatest results to be written to arbitrary file --- test/juliatests.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/juliatests.jl b/test/juliatests.jl index 23a9e137..6b4bd7e3 100644 --- a/test/juliatests.jl +++ b/test/juliatests.jl @@ -29,6 +29,7 @@ function test_path(test) end nstmts = 10^4 # very quick, aborts a lot +outputfile = "results.md" i = 1 while i <= length(ARGS) global i @@ -36,6 +37,9 @@ while i <= length(ARGS) if a == "--nstmts" global nstmts = parse(Int, ARGS[i+1]) deleteat!(ARGS, i:i+1) + elseif a == "--output" + global outputfile = ARGS[i+1] + deleteat!(ARGS, i:i+1) else i += 1 end @@ -136,7 +140,7 @@ move_to_node1("Distributed") foreach(wait, all_tasks) end - open("results.md", "w") do io + open(outputfile, "w") do io versioninfo(io) println(io, "Test run at: ", now()) println(io)