From c8c599fdea5036552aad373de1a1991455b4d0a0 Mon Sep 17 00:00:00 2001
From: Marco Antognini <antognini.marco@gmail.com>
Date: Fri, 4 Mar 2016 10:43:26 +0100
Subject: [PATCH] Fix crash in ClassgenPhase

Avoid crash when the temporary directory `tmp` doesn't exists, instead
rely on the default, system-wide temporary directory.
---
 src/main/scala/leon/frontends/scalac/ClassgenPhase.scala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/scala/leon/frontends/scalac/ClassgenPhase.scala b/src/main/scala/leon/frontends/scalac/ClassgenPhase.scala
index b26507404..3ac856763 100644
--- a/src/main/scala/leon/frontends/scalac/ClassgenPhase.scala
+++ b/src/main/scala/leon/frontends/scalac/ClassgenPhase.scala
@@ -31,7 +31,7 @@ object ClassgenPhase extends LeonPhase[List[String], List[String]] {
         _.getLocation.getPath
       }.orElse( for {
         // We are in Eclipse. Look in Eclipse plugins to find scala lib
-        eclipseHome <- Option(System.getenv("ECLIPSE_HOME")) 
+        eclipseHome <- Option(System.getenv("ECLIPSE_HOME"))
         pluginsHome = eclipseHome + "/plugins"
         plugins <- scala.util.Try(new File(pluginsHome).listFiles().map{ _.getAbsolutePath }).toOption
         path <- plugins.find{ _ contains "scala-library"}
@@ -40,7 +40,7 @@ object ClassgenPhase extends LeonPhase[List[String], List[String]] {
         "make sure to set the ECLIPSE_HOME environment variable to your Eclipse installation home directory"
       ))
 
-      val tempOut = Files.createTempDirectory(new File("tmp/").toPath, "classes").toFile
+      val tempOut = Files.createTempDirectory("classes").toFile
 
       settings.classpath.value   = scalaLib
       settings.usejavacp.value   = false
-- 
GitLab