Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

warn about inttoptr/ptrtoint in QUANTUM == 1

  • Loading branch information...
commit ab754ce645f4d89fa92e25545523cc9c3c2eff21 1 parent 1b2b60f
@kripken authored
Showing with 14 additions and 2 deletions.
  1. +14 −2 src/parseTools.js
View
16 src/parseTools.js
@@ -978,8 +978,20 @@ function processMathop(item) { with(item) {
return '((' + ident1 + ') & ' + (Math.pow(2, bitsLeft)-1) + ')';
}
case 'select': return ident1 + ' ? ' + ident2 + ' : ' + ident3;
- case 'ptrtoint': return ident1;
- case 'inttoptr': return ident1;
+ case 'ptrtoint': case 'inttoptr': {
+ var ret = '';
+ if (QUANTUM_SIZE == 1) {
+ if (!Debugging.shownPtrtointWarning) {
+ dprint('WARNING: .ll contains ptrtoint and/or inttoptr. These may be dangerous in QUANTUM == 1.');
+ dprint(' The safest thing is to investigate every appearance, and modify the source code to avoid this.');
+ dprint(' Emscripten will print a list of the .ll lines, and also annotate the .js.');
+ Debugging.shownPtrtointWarning = true;
+ }
+ dprint(' ' + op + ' on .ll line ' + item.lineNum);
+ ret = ' /* Warning: ' + op + ', .ll line ' + item.lineNum + ' */';
+ }
+ return ident1 + ret;
+ }
default: throw 'Unknown mathcmp op: ' + item.op;
}
} }
Please sign in to comment.
Something went wrong with that request. Please try again.