Mercurial > hg > truffle
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeGenFactory.java @ 18787:6fe1d34a7b6e
Truffle-DSL: added bounds check for unrolling child arrays.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 05 Jan 2015 20:23:22 +0100 |
parents | 93016f2f3f16 |
children | 714f4931b02c |
comparison
equal
deleted
inserted
replaced
18786:eecda5abf627 | 18787:6fe1d34a7b6e |
---|---|
255 accessor = callTemplateMethod(null, createCast, accessor); | 255 accessor = callTemplateMethod(null, createCast, accessor); |
256 } | 256 } |
257 | 257 |
258 if (execution.isIndexed()) { | 258 if (execution.isIndexed()) { |
259 CodeTreeBuilder nullCheck = builder.create(); | 259 CodeTreeBuilder nullCheck = builder.create(); |
260 nullCheck.string(name).string(" != null ? "); | 260 nullCheck.string(name).string(" != null && ").string(String.valueOf(execution.getIndex())).string(" < ").string(name).string(".length").string(" ? "); |
261 nullCheck.tree(accessor); | 261 nullCheck.tree(accessor); |
262 nullCheck.string(" : null"); | 262 nullCheck.string(" : null"); |
263 accessor = nullCheck.build(); | 263 accessor = nullCheck.build(); |
264 } | 264 } |
265 | 265 |