Skip to content

Commit

Permalink
Release 0.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanTAllen committed Jul 30, 2017
2 parents 42e7865 + 6bca540 commit f074afa
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 16 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

*.bat win

pony.g export-ignore
.gitattributes export-ignore
.gitignore export-ignore

Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to the Pony compiler and standard library will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a CHANGELOG](http://keepachangelog.com/).

## [0.16.1] - 2017-07-30

### Fixed

- Fix reachability analysis for intersection types ([PR #2106](https://github.com/ponylang/ponyc/pull/2106))
- Fix compiler assertion failure at code generation ([PR #2099](https://github.com/ponylang/ponyc/pull/2099))
- FreeBSD builds([PR #2107](https://github.com/ponylang/ponyc/pull/2107))

## [0.16.0] - 2017-07-28

### Fixed
Expand Down Expand Up @@ -827,5 +835,5 @@ All notable changes to the Pony compiler and standard library will be documented
- When using a package without a package identifier (eg. `use "foo"` as opposed to `use f = "foo"`), a `Main` type in the package will not be imported. This allows all packages to include unit tests that are run from their included `Main` actor without causing name conflicts.
- The `for` sugar now wraps the `next()` call in a try expression that does a `continue` if an error is raised.

ised.
ontinue` if an error is raised.

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ ifeq ($(OSTYPE),linux)
endif

ifeq ($(OSTYPE),freebsd)
libponyc.tests.links += libpthread
libponyrt.tests.links += libpthread
libponyc.benchmarks.links += libpthread
libponyrt.benchmarks.links += libpthread
endif
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,30 @@ $ ./build/release/ponyc examples/helloworld
$ ./helloworld
```

### Apline (Edge)

Install build tools/dependencies:

```bash
apk add --update alpine-sdk libressl-dev binutils-gold llvm3.9 llvm3.9-dev pcre2-dev libunwind-dev coreutils
```

To build ponyc, compile and run helloworld:

```bash
$ cd ~/ponyc/
$ make
$ ./build/release/ponyc --pic examples/helloworld
$ ./helloworld
```

NOTE: You need to pass `--pic` to `ponyc` or you will get errors like the following during linking:

```bash
/usr/bin/ld.gold: error: ./fb.o: requires dynamic R_X86_64_32 reloc against
'Array_String_val_Trace' which may overflow at runtime; recompile with -fPIC
```

### Other Linux distributions

You need to have the development versions of the following installed:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.16.0
0.16.1
4 changes: 2 additions & 2 deletions src/libponyc/codegen/genfun.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,14 +675,14 @@ static bool genfun_forward(compile_t* c, reach_type_t* t,
LLVMValueRef value = LLVMGetParam(c_m->func, i);
args[i] = gen_assign_cast(c,
((compile_type_t*)m2->params[i - 1].type->c_type)->use_type, value,
m->params[i - 1].type->ast);
m->params[i - 1].type->ast_cap);
}

codegen_debugloc(c, m2->r_fun);
LLVMValueRef ret = codegen_call(c, c_m2->func, args, count, m->cap != TK_AT);
codegen_debugloc(c, NULL);
ret = gen_assign_cast(c, ((compile_type_t*)m->result->c_type)->use_type, ret,
m2->result->ast);
m2->result->ast_cap);
LLVMBuildRet(c->builder, ret);
codegen_finishfun(c);
return true;
Expand Down
25 changes: 18 additions & 7 deletions src/libponyc/reach/reach.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,9 @@ static void add_rmethod_to_subtype(reach_t* r, reach_type_t* t,
static void add_rmethod_to_subtypes(reach_t* r, reach_type_t* t,
reach_method_name_t* n, reach_method_t* m, pass_opt_t* opt, bool internal)
{
bool typeexpr = false;
switch(t->underlying)
{
case TK_UNIONTYPE:
case TK_ISECTTYPE:
typeexpr = true;
// fallthrough

case TK_INTERFACE:
case TK_TRAIT:
{
Expand All @@ -308,16 +303,32 @@ static void add_rmethod_to_subtypes(reach_t* r, reach_type_t* t,

while((t2 = reach_type_cache_next(&t->subtypes, &i)) != NULL)
{
if(!internal && typeexpr)
if(!internal || valid_internal_method_for_type(t2, n->name))
add_rmethod_to_subtype(r, t2, n, m, opt, internal);
}

break;
}

case TK_ISECTTYPE:
{
ast_t* child = ast_child(t->ast_cap);
reach_type_t* t2;

for(; child != NULL; child = ast_sibling(child))
{
if(!internal)
{
ast_t* find = lookup_try(NULL, NULL, t2->ast, n->name);
ast_t* find = lookup_try(NULL, NULL, child, n->name);

if(find == NULL)
continue;

ast_free_unattached(find);
}

t2 = add_type(r, child, opt);

if(!internal || valid_internal_method_for_type(t2, n->name))
add_rmethod_to_subtype(r, t2, n, m, opt, internal);
}
Expand Down
10 changes: 6 additions & 4 deletions src/libponyrt/mem/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,16 +1055,18 @@ void ponyint_pool_thread_cleanup()

size_t ponyint_pool_index(size_t size)
{
if(size <= POOL_MIN)
return 0;

#ifdef PLATFORM_IS_ILP32
#define BITS (32 - POOL_MIN_BITS)
#else
#define BITS (64 - POOL_MIN_BITS)
#endif

return (size_t)BITS - __pony_clzl(size) - (!(size & (size - 1)));
// The condition is in that order for better branch prediction: non-zero pool
// indices are more likely than zero pool indices.
if(size > POOL_MIN)
return (size_t)BITS - __pony_clzl(size) - (!(size & (size - 1)));

return 0;
}

size_t ponyint_pool_size(size_t index)
Expand Down
20 changes: 20 additions & 0 deletions test/libponyc/badpony.cc
Original file line number Diff line number Diff line change
Expand Up @@ -818,3 +818,23 @@ TEST_F(BadPonyTest, DontCareUnusedBranchValue)

TEST_COMPILE(src);
}

TEST_F(BadPonyTest, ForwardTuple)
{
// From issue #2097
const char* src =
"class val X\n"

"trait T\n"
" fun f(): Any val\n"

"class C is T\n"
" fun f(): (X, USize) => (X, 0)\n"

"actor Main\n"
" new create(env: Env) =>\n"
" let t: T = C\n"
" t.f()";

TEST_COMPILE(src);
}

0 comments on commit f074afa

Please sign in to comment.