<< Back to previous view

[MATCH-56] IndexOutOfBoundsException when matching empty vector Created: 27/Mar/12  Updated: 28/Jul/13  Resolved: 16/Jun/13

Status: Closed
Project: core.match
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Greg Chapman Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None
Environment:

Clojure 1.3


Attachments: File match.clj.diff    

 Description   

Using the latest core.match:

user=> (let [x []] (match [x] [[h & t]] [h t] :else :nomatch))
IndexOutOfBoundsException   clojure.lang.RT.subvec (RT.java:1451)

Not sure if this is the best fix, but I resolved this specific case by slightly changing subvec-inline (see attached diff).



 Comments   
Comment by David Nolen [ 27/Mar/12 10:28 AM ]

Thanks for the report. The patch is not going to work - we should be checking that the vector has at least one item.

Comment by David Nolen [ 16/Jun/13 10:08 PM ]

fixed http://github.com/clojure/core.match/commit/59df5b32b3c06b0038f76ccb88670fa9f42e5547

Generated at Thu Dec 18 06:38:48 CST 2014 using JIRA 4.4#649-r158309.