Log of the #nice channel on irc.freenode.net

Using timezone: Central European Time
* CIA-6 leaves00:21
* CIA-4 joins
* arjanb leaves00:28
* CIA-4 leaves00:30
* CIA-4 joins
* CIA-4 leaves00:31
* CIA-5 joins
* arjanb joins11:33
* CIA-5 leaves12:31
* CIA-1 joins
* rubber joins12:56
hi
I found a new compiler bug.13:05
strange to me...13:06
<arjanb>hello13:30
<rubber>:)13:32
<arjanb>what's the problem?13:34
<rubber>I get the following error:13:35
[nicec] Stack trace:13:36
[nicec] Exception in thread "main" java.lang.Error: at PC 203 then clause grows stack with no else clause
[nicec] at gnu.bytecode.CodeAttr.emitFi(CodeAttr.java:1508)
[nicec] at gnu.expr.SimpleIfExp.compile(SimpleIfExp.java:60)
[nicec] at gnu.expr.SimpleIfExp.compile(SimpleIfExp.java:24)
[nicec] at gnu.expr.Expression.compileNotePosition(Expression.java:82)
[nicec] at gnu.expr.Expression.compileWithPosition(Expression.java:69)
[nicec] at gnu.expr.BeginExp.compile(BeginExp.java:80)
<arjanb>can you find the part of the source code causing this?13:37
<rubber>Yes, but there is another one:13:38
[nicec] Stack trace:
[nicec] Exception in thread "main" java.lang.Error: attempting to push dead variable
[nicec] at gnu.bytecode.CodeAttr.emitLoad(CodeAttr.java:945)
[nicec] at gnu.expr.Declaration.load(Declaration.java:139)
[nicec] at gnu.expr.ReferenceExp.compile(ReferenceExp.java:112)
[nicec] at gnu.expr.SimpleIfExp.compile(SimpleIfExp.java:44)
[nicec] at gnu.expr.SimpleIfExp.compile(SimpleIfExp.java:24)
[nicec] at gnu.expr.Expression.compileNotePosition(Expression.java:82)
[nicec] at gnu.expr.Expression.compileWithPosition(Expression.java:69)
[nicec] at gnu.expr.BeginExp.compile(BeginExp.java:84)
First one comes from code fragment:13:39
if (ba.length == 0) {13:40
ok, old method
try {
ba = parent.io.compressFile(parent.file);
} catch (IOException ioe) {
IOException e = ioe;
parent.d.syncExec(new RunnableAdapter(run: () => {
Log.errln(e.toString());
MessageBox mb = new MessageBox(s, SWT.ICON_ERROR);
mb.setText("Fehler");
mb.setMessage("Fehler beim packen\n"+e.toString());
mb.getParent().forceActive();
mb.open();
}));
}
}
...
Aeh, that is the code working! But without the IOException e = ioe; and using ioe directly, the compiler fails.13:41
Ok, second case is nearly the same... in the catch is quite the same code.13:42
<arjanb>i could reproduce the first13:46
<rubber>:)13:47
<arjanb>it seems capturing catch variables in anonymous functions goes wrong
can you show the second case?13:51
<rubber>...13:56
int counter = 3;
(int, int) pt = (-1, -1);
try {
if (parent.conn.ptRequired()) {
* rubber leaves
* rubber joins
}
verflixt.
Mom.
ignore last }13:57
do {
PinTanGui ptg = new PinTanGui(parent: parent);
parent.d.syncExec(new RunnableAdapter(run: () => {
if (!t.isDisposed()) t.setText("Waiting for pin/tan, please wait");
if (!s.isDisposed()) {
ptg.init(s.getText());
ptg.run();
}
}));
if (!parent.conn.checkPT(ptg.pt)) {
counter--;
// uups, PIN and/or TAN wrong!
parent.d.syncExec(new RunnableAdapter(run: () => {
if (!s.isDisposed()) {
MessageBox mb = new MessageBox(s, SWT.ICON_WARNING);
mb.setText("Fehler");
mb.setMessage("PIN/TAN Eingabe falsch.");
mb.getParent().forceActive();
mb.open();
}
}
}));
} else {
pt = ptg.pt;
counter = -1;
}
} while (counter > 0);
} else {
pt = (0, 0);
}
} catch (IOException ioe) {
IOException e = ioe;
parent.d.syncExec(new RunnableAdapter(run: () => {13:58
Log.errln(ioe.toString());
MessageBox mb = new MessageBox(s, SWT.ICON_ERROR);
mb.setText("Fehler");
mb.setMessage("Netzwerk-Fehler beim PIN/TAN check\n"+e.toString());
mb.getParent().forceActive();
mb.open();
}));
counter = -2;
}
...
that's the try/catch
[nicec] Exception in thread "main" java.lang.Error: attempting to push dead variable
[nicec] at gnu.bytecode.CodeAttr.emitLoad(CodeAttr.java:945)
[nicec] at gnu.expr.Declaration.load(Declaration.java:139)
[nicec] at gnu.expr.ReferenceExp.compile(ReferenceExp.java:112)
[nicec] at gnu.expr.SimpleIfExp.compile(SimpleIfExp.java:44)
[nicec] at gnu.expr.SimpleIfExp.compile(SimpleIfExp.java:24)
[nicec] at gnu.expr.Expression.compileNotePosition(Expression.java:82)
[nicec] at gnu.expr.Expression.compileWithPosition(Expression.java:69)
[nicec] at gnu.expr.BeginExp.compile(BeginExp.java:84)
<arjanb>let's see if i can simplify this one a bit14:01
<rubber>:)14:11
<arjanb>does the same workaround help here?
<rubber>yes.
I was suprised, that this are different errors.14:12
<arjanb>they probably have the same cause but the bytecode lib detects at different places that something is wrong14:14
<rubber>Possible.14:18
I have to leave. Hopefully you'll find the errors.16:21
bye
* rubber leaves
* rubber joins17:02
re
hi
Are you still online?
<arjanb>yes17:03
<rubber>I've forgotten something...
..something about tuples...
(String, String, String, boolean)[] b = ...?
How to init?
new (String[], String[], String[], boolean[]);
new (String, String, String, boolean)[length];
both don't work.
b[j] = (date, id, state, done); that does work, but I don't now how to init...17:04
Do you have an idea?17:05
<arjanb>i think we forgot this combination
<rubber>? Only in the parser but also deeper?17:06
<arjanb>i'm not sure17:07
<rubber>;)
<arjanb>you can use a literal array of tuples
<rubber>?
wdym?17:08
<arjanb>... = [("abc",5),("zyx",3)];17:09
<rubber>but than I need to know all the values at first...17:10
<arjanb>and what about making it a tuple of arrays instead of an array of tuples17:11
<rubber>I'm already trying it.17:12
Ok, does work *nice*ly.17:14
But; I'm always using String[] dates = cast(new String[l]); to avoid
[nicec] Incorrect type in assignment to dates
[nicec] Found : ?java.lang.String[]
[nicec] Expected: java.lang.String[]
<arjanb>you know the fill function in the stdlib?17:15
<rubber>The compiler is right about ?java.lang.String[], but ...
No
<arjanb>String[] x = new String[10].fill(int i => "string #"+i);17:17
<rubber>Ah, Ok. Than I would'nt need the cast...17:18
for (int i = 0; i < array.length; i++)
array[i] = value(i);
return cast(array);
but there also is the cast :)
<arjanb>i got a strange error when looking for a workaround:17:21
Arguments (<nullness, Traw | nullness < nice.lang.Maybe, nullness<Traw> <: T, T <: nullness<Traw>> ?17:22
Traw[]) do not fit:
<T, U> U cast(T)
<rubber>;?
<arjanb>the compiler is full of surprises17:25
<rubber>:-)
Where is Daniel btw.
<arjanb>i don't know haven't seen him for a few days17:26
<rubber>Hmmm. He refuges from such surprises... 17:28
...or do you think he would like them?
<arjanb>i doubt that a type theorist would like a unpredictable compiler17:32
<rubber>;-)))17:36
I first read "type terrorist" 17:37
<arjanb>:-)
* rubber leaves19:01
* rubber joins19:11
connection reset...
:(
Did you already found some reasons for any bug? Or are you not working on them now?
<arjanb>i'm not working on that bug now19:12
<rubber>ok.19:13
Ok, now I really have to leave. My wife is crying for me...19:14
have a nice evening...
<arjanb>cu19:15
<rubber>bye
* rubber leaves
<CIA-1>03arjanb * 10Nice/testsuite/compiler/statements/exceptions.testsuite: Testcase for a code generation bug.19:37
* CIA-1 leaves20:24
* CIA-2 joins

Generated by Sualtam