summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/reify
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-11-06 16:58:08 +1000
committerJason Zaugg <jzaugg@gmail.com>2014-11-06 17:09:21 +1000
commit17992f672f7d5663654a1ea365dfd1dad7061410 (patch)
treedf0be801ef2ce2c6679980f6082456ff1b121967 /src/compiler/scala/reflect/reify
parentd056439a2762b342f66759de654f0dadb01f5e9a (diff)
downloadscala-17992f672f7d5663654a1ea365dfd1dad7061410.tar.gz
scala-17992f672f7d5663654a1ea365dfd1dad7061410.tar.bz2
scala-17992f672f7d5663654a1ea365dfd1dad7061410.zip
SI-8947 Additional layers of defence against EmptyTree mutation
As suggested in review: - Use `abort` rather than `{error; EmptyTree} when we hit an error in reification or tag materialization. - Explicitly avoid adding the `MacroExpansionAttachment` to the macro expansion if it an `EmptyTree` - Emit a `-Xdev` warning if any other code paths find a way to mutate attachments in places they shouldn't.
Diffstat (limited to 'src/compiler/scala/reflect/reify')
-rw-r--r--src/compiler/scala/reflect/reify/Taggers.scala3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/compiler/scala/reflect/reify/Taggers.scala b/src/compiler/scala/reflect/reify/Taggers.scala
index 093c2bee22..0863ee38f9 100644
--- a/src/compiler/scala/reflect/reify/Taggers.scala
+++ b/src/compiler/scala/reflect/reify/Taggers.scala
@@ -79,8 +79,7 @@ abstract class Taggers {
try materializer
catch {
case ReificationException(pos, msg) =>
- c.error(pos.asInstanceOf[c.Position], msg) // this cast is a very small price for the sanity of exception handling
- EmptyTree
+ c.abort(pos.asInstanceOf[c.Position], msg) // this cast is a very small price for the sanity of exception handling
case UnexpectedReificationException(pos, err, cause) if cause != null =>
throw cause
}