Aladdin - Scala Bugtracking
[#1021] project: compiler priority: low category: bug
submitter assigned to status date submitted
Nikolay Burak fixed 2007-03-26 11:03:48.0
subject [contrib #404] Unescaped ampersands in XML attribute literals crash
code
object X {
  val z = <x y="&"/>
}
what happened
test.scala:2: error: in XML literal: error parsing attribute value
        val z = 
                        ^
test.scala:3: error: in XML literal: in XML content, please use '}}' to express '}'
}
 ^
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
what expected Noting that == , I'm assuming that the first error is correct. The second isn't, but is just about acceptable (given that the first is happening). The OutOfMemoryError definitely shouldn't be happening.
[back to overview]
Changes of this bug report
Nikolay  edited on  2007-03-26 11:04:25.0
Contribution #404
Burak  edited on  2007-07-03 19:24:07.0
formatting
Burak  edited on  2007-08-14 18:28:55.0
it doesn't do outofmem errors anymore. i guess error recovery of the thing could be improved =:o I mark it as fixed anyway. The output is now
/tmp/amp.scala:2: error: in XML literal: error parsing attribute value
          val z = 
                          ^
/tmp/amp.scala:3: error: in XML literal: in XML content, please use '}}' to express '}'
}
 ^
/tmp/amp.scala:2: error:  I encountered a '}' where I didn't expect one, maybe this tag isn't closed 
          val z = 
                    ^
/tmp/amp.scala:2: error: ';' expected but $XMLSTART$< found.
          val z = 
                  ^
/tmp/amp.scala:4: error: '}' expected but eof found.

^
5 errors found

Burak  edited on  2007-08-14 18:29:51.0
BTW I changed the code to reflect the intention of the original poster, luckily the subject speakes of UNescaped ampersands, but in the meantime aladdin's escaping rules had changed.