aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/gluegen/JavaEmitter.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-01-03 02:36:17 +0000
committerKenneth Russel <[email protected]>2006-01-03 02:36:17 +0000
commitb69f8b201ba3767020d33a7ebe066466f00d4223 (patch)
treeac4c77e5256026f4c1de771e49d89941645e60e2 /src/classes/com/sun/gluegen/JavaEmitter.java
parent6b4308e8b3dc41d588ff9e7519da813705a3cd94 (diff)
Added checks on number of remaining elements and bytes for Buffers and
arrays passed to certain APIs. Default is to not emit such range checks. The checks are currently most fully implemented for image- and texture-related APIs. Verified with debugging code and with demos that all textures used in demos are properly checked. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@509 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/gluegen/JavaEmitter.java')
-rw-r--r--src/classes/com/sun/gluegen/JavaEmitter.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/classes/com/sun/gluegen/JavaEmitter.java b/src/classes/com/sun/gluegen/JavaEmitter.java
index d4bafb7a8..f0799067e 100644
--- a/src/classes/com/sun/gluegen/JavaEmitter.java
+++ b/src/classes/com/sun/gluegen/JavaEmitter.java
@@ -377,6 +377,8 @@ public class JavaEmitter implements GlueEmitter {
emitter.setReturnedArrayLengthExpression(cfg.returnedArrayLength(binding.getName()));
emitter.setPrologue(prologue);
emitter.setEpilogue(epilogue);
+ emitter.setRangeCheckExpressions(cfg.rangeCheckExpressions(binding.getName()));
+ emitter.setByteRangeCheckExpressions(cfg.byteRangeCheckExpressions(binding.getName()));
allEmitters.add(emitter);
}
@@ -430,6 +432,8 @@ public class JavaEmitter implements GlueEmitter {
}
emitter.addModifier(JavaMethodBindingEmitter.NATIVE);
emitter.setReturnedArrayLengthExpression(cfg.returnedArrayLength(binding.getName()));
+ emitter.setRangeCheckExpressions(cfg.rangeCheckExpressions(binding.getName()));
+ emitter.setByteRangeCheckExpressions(cfg.byteRangeCheckExpressions(binding.getName()));
allEmitters.add(emitter);
// Optionally emit the entry point taking arrays which handles
@@ -455,6 +459,8 @@ public class JavaEmitter implements GlueEmitter {
}
emitter.addModifier(JavaMethodBindingEmitter.NATIVE);
emitter.setReturnedArrayLengthExpression(cfg.returnedArrayLength(binding.getName()));
+ emitter.setRangeCheckExpressions(cfg.rangeCheckExpressions(binding.getName()));
+ emitter.setByteRangeCheckExpressions(cfg.byteRangeCheckExpressions(binding.getName()));
allEmitters.add(emitter);
}
}