compiler API: final cleanups; improve security by diabling 'gorge' and friends

This commit is contained in:
Andreas Rumpf 2018-05-29 09:07:24 +02:00
commit 688c54d8f1
9 changed files with 55 additions and 28 deletions

View file

@ -9,6 +9,9 @@
## Nimsuggest is a tool that helps to give editors IDE like capabilities.
when not defined(nimcore):
{.error: "nimcore MUST be defined for Nim's core tooling".}
import strutils, os, parseopt, parseutils, sequtils, net, rdstdin, sexp
# Do NOT import suggest. It will lead to wierd bugs with
# suggestionResultHook, because suggest.nim is included by sigmatch.
@ -486,9 +489,9 @@ var
proc mainCommand(graph: ModuleGraph; cache: IdentCache) =
let conf = graph.config
clearPasses()
registerPass verbosePass
registerPass semPass
clearPasses(graph)
registerPass graph, verbosePass
registerPass graph, semPass
conf.cmd = cmdIdeTools
incl conf.globalOptions, optCaasEnabled
wantMainModule(conf)

View file

@ -8,6 +8,8 @@ path:"$lib/packages/docutils"
define:useStdoutAsStdmsg
define:nimsuggest
define:nimcore
# die when nimsuggest uses more than 4GB:
@if cpu32:
define:"nimMaxHeap=2000"
@ -15,7 +17,6 @@ define:nimsuggest
define:"nimMaxHeap=4000"
@end
#cs:partial
#define:useNodeIds
#define:booting
#define:noDocgen